cmake.vim (1004B)
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 7 " Only do this when not done yet for this buffer 8 if exists("b:did_ftplugin") 9 finish 10 endif 11 12 " save 'cpo' for restoration at the end of this file 13 let s:cpo_save = &cpo 14 set cpo&vim 15 16 " Don't load another plugin for this buffer 17 let b:did_ftplugin = 1 18 19 let b:undo_ftplugin = "setl inc< sua< commentstring<" 20 21 if exists('loaded_matchit') 22 let b:match_words = '\<if\>:\<elseif\>\|\<else\>:\<endif\>' 23 \ . ',\<foreach\>\|\<while\>:\<break\>:\<endforeach\>\|\<endwhile\>' 24 \ . ',\<macro\>:\<endmacro\>' 25 \ . ',\<function\>:\<endfunction\>' 26 let b:match_ignorecase = 1 27 28 let b:undo_ftplugin .= "| unlet b:match_words" 29 endif 30 31 setlocal include=\s*include 32 setlocal suffixesadd=.cmake,-config.cmake 33 setlocal commentstring=#\ %s 34 35 " restore 'cpo' and clean up buffer variable 36 let &cpo = s:cpo_save 37 unlet s:cpo_save