cmake.vim 1004 B

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