cmake.vim 867 B

1234567891011121314151617181920212223242526272829303132333435
  1. " Vim filetype plugin
  2. " Language: CMake
  3. " Maintainer: Keith Smiley <keithbsmiley@gmail.com>
  4. " Last Change: 2018 Aug 30
  5. " Only do this when not done yet for this buffer
  6. if exists("b:did_ftplugin")
  7. finish
  8. endif
  9. " save 'cpo' for restoration at the end of this file
  10. let s:cpo_save = &cpo
  11. set cpo&vim
  12. " Don't load another plugin for this buffer
  13. let b:did_ftplugin = 1
  14. let b:undo_ftplugin = "setl commentstring<"
  15. if exists('loaded_matchit')
  16. let b:match_words = '\<if\>:\<elseif\>\|\<else\>:\<endif\>'
  17. \ . ',\<foreach\>\|\<while\>:\<break\>:\<endforeach\>\|\<endwhile\>'
  18. \ . ',\<macro\>:\<endmacro\>'
  19. \ . ',\<function\>:\<endfunction\>'
  20. let b:match_ignorecase = 1
  21. let b:undo_ftplugin .= "| unlet b:match_words"
  22. endif
  23. setlocal commentstring=#\ %s
  24. " restore 'cpo' and clean up buffer variable
  25. let &cpo = s:cpo_save
  26. unlet s:cpo_save