xref: /vim-8.2.3635/runtime/ftplugin/cmake.vim (revision 20aac6c1)
1df980db6SBram Moolenaar" Vim filetype plugin
2df980db6SBram Moolenaar" Language:    CMake
3df980db6SBram Moolenaar" Maintainer:  Keith Smiley <[email protected]>
4*20aac6c1SBram Moolenaar" Last Change: 2018 Aug 30
5df980db6SBram Moolenaar
6df980db6SBram Moolenaar" Only do this when not done yet for this buffer
7df980db6SBram Moolenaarif exists("b:did_ftplugin")
8df980db6SBram Moolenaar  finish
9df980db6SBram Moolenaarendif
10df980db6SBram Moolenaar
11*20aac6c1SBram Moolenaar" save 'cpo' for restoration at the end of this file
12*20aac6c1SBram Moolenaarlet s:cpo_save = &cpo
13*20aac6c1SBram Moolenaarset cpo&vim
14*20aac6c1SBram Moolenaar
15df980db6SBram Moolenaar" Don't load another plugin for this buffer
16df980db6SBram Moolenaarlet b:did_ftplugin = 1
17df980db6SBram Moolenaar
18df980db6SBram Moolenaarlet b:undo_ftplugin = "setl commentstring<"
19df980db6SBram Moolenaar
20*20aac6c1SBram Moolenaarif exists('loaded_matchit')
21*20aac6c1SBram Moolenaar  let b:match_words = '\<if\>:\<elseif\>\|\<else\>:\<endif\>'
22*20aac6c1SBram Moolenaar        \ . ',\<foreach\>\|\<while\>:\<break\>:\<endforeach\>\|\<endwhile\>'
23*20aac6c1SBram Moolenaar        \ . ',\<macro\>:\<endmacro\>'
24*20aac6c1SBram Moolenaar        \ . ',\<function\>:\<endfunction\>'
25*20aac6c1SBram Moolenaar  let b:match_ignorecase = 1
26*20aac6c1SBram Moolenaar
27*20aac6c1SBram Moolenaar  let b:undo_ftplugin .= "| unlet b:match_words"
28*20aac6c1SBram Moolenaarendif
29*20aac6c1SBram Moolenaar
30df980db6SBram Moolenaarsetlocal commentstring=#\ %s
31*20aac6c1SBram Moolenaar
32*20aac6c1SBram Moolenaar" restore 'cpo' and clean up buffer variable
33*20aac6c1SBram Moolenaarlet &cpo = s:cpo_save
34*20aac6c1SBram Moolenaarunlet s:cpo_save
35