nosyntax.vim 755 B

12345678910111213141516171819202122232425262728293031
  1. " Vim syntax support file
  2. " Maintainer: Bram Moolenaar <Bram@vim.org>
  3. " Last Change: 2006 Apr 16
  4. " This file is used for ":syntax off".
  5. " It removes the autocommands and stops highlighting for all buffers.
  6. if !has("syntax")
  7. finish
  8. endif
  9. " Remove all autocommands for the Syntax event. This also avoids that
  10. " "syntax=foo" in a modeline triggers the SynSet() function of synload.vim.
  11. au! Syntax
  12. " remove all syntax autocommands and remove the syntax for each buffer
  13. augroup syntaxset
  14. au!
  15. au BufEnter * syn clear
  16. au BufEnter * if exists("b:current_syntax") | unlet b:current_syntax | endif
  17. doautoall syntaxset BufEnter *
  18. au!
  19. augroup END
  20. if exists("syntax_on")
  21. unlet syntax_on
  22. endif
  23. if exists("syntax_manual")
  24. unlet syntax_manual
  25. endif