lua.vim 973 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. " Vim filetype plugin file.
  2. " Language: Lua 4.0+
  3. " Maintainer: Max Ischenko <mfi@ukr.net>
  4. " Last Change: 2012 Mar 07
  5. " Only do this when not done yet for this buffer
  6. if exists("b:did_ftplugin")
  7. finish
  8. endif
  9. " Don't load another plugin for this buffer
  10. let b:did_ftplugin = 1
  11. let s:cpo_save = &cpo
  12. set cpo&vim
  13. " Set 'formatoptions' to break comment lines but not other lines, and insert
  14. " the comment leader when hitting <CR> or using "o".
  15. setlocal fo-=t fo+=croql
  16. setlocal com=:--
  17. setlocal cms=--%s
  18. setlocal suffixesadd=.lua
  19. " The following lines enable the macros/matchit.vim plugin for
  20. " extended matching with the % key.
  21. if exists("loaded_matchit")
  22. let b:match_ignorecase = 0
  23. let b:match_words =
  24. \ '\<\%(do\|function\|if\)\>:' .
  25. \ '\<\%(return\|else\|elseif\)\>:' .
  26. \ '\<end\>,' .
  27. \ '\<repeat\>:\<until\>'
  28. endif " exists("loaded_matchit")
  29. let &cpo = s:cpo_save
  30. unlet s:cpo_save
  31. let b:undo_ftplugin = "setlocal fo< com< cms< suffixesadd<"