2018-10-28 05:59:07 -07:00
|
|
|
" Vim filetype plugin
|
|
|
|
" Language: CMake
|
|
|
|
" Maintainer: Keith Smiley <keithbsmiley@gmail.com>
|
2018-10-29 15:54:34 -07:00
|
|
|
" Last Change: 2018 Aug 30
|
2024-04-20 09:07:52 -07:00
|
|
|
" 2024 Apr 20 - add include and suffixadd (Vim Project)
|
2018-10-28 05:59:07 -07:00
|
|
|
|
|
|
|
" Only do this when not done yet for this buffer
|
|
|
|
if exists("b:did_ftplugin")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
2018-10-29 15:54:34 -07:00
|
|
|
" save 'cpo' for restoration at the end of this file
|
|
|
|
let s:cpo_save = &cpo
|
|
|
|
set cpo&vim
|
|
|
|
|
2018-10-28 05:59:07 -07:00
|
|
|
" Don't load another plugin for this buffer
|
|
|
|
let b:did_ftplugin = 1
|
|
|
|
|
2024-04-20 09:07:52 -07:00
|
|
|
let b:undo_ftplugin = "setl inc< sua< commentstring<"
|
2018-10-28 05:59:07 -07:00
|
|
|
|
2018-10-29 15:54:34 -07:00
|
|
|
if exists('loaded_matchit')
|
|
|
|
let b:match_words = '\<if\>:\<elseif\>\|\<else\>:\<endif\>'
|
|
|
|
\ . ',\<foreach\>\|\<while\>:\<break\>:\<endforeach\>\|\<endwhile\>'
|
|
|
|
\ . ',\<macro\>:\<endmacro\>'
|
|
|
|
\ . ',\<function\>:\<endfunction\>'
|
|
|
|
let b:match_ignorecase = 1
|
|
|
|
|
|
|
|
let b:undo_ftplugin .= "| unlet b:match_words"
|
|
|
|
endif
|
|
|
|
|
2024-04-20 09:07:52 -07:00
|
|
|
setlocal include=\s*include
|
|
|
|
setlocal suffixesadd=.cmake,-config.cmake
|
2018-10-28 05:59:07 -07:00
|
|
|
setlocal commentstring=#\ %s
|
2018-10-29 15:54:34 -07:00
|
|
|
|
|
|
|
" restore 'cpo' and clean up buffer variable
|
|
|
|
let &cpo = s:cpo_save
|
|
|
|
unlet s:cpo_save
|