1
0
Fork 0
mirror of https://github.com/vim/vim synced 2025-03-21 01:05:11 +01:00
vim/runtime/ftplugin/cmake.vim

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
1,004 B
VimL
Raw Normal View History

2017-12-24 13:22:00 +01:00
" Vim filetype plugin
" Language: CMake
" Maintainer: Keith Smiley <keithbsmiley@gmail.com>
2018-09-02 21:07:30 +02:00
" Last Change: 2018 Aug 30
" 2024 Apr 20 - add include and suffixadd (Vim Project)
2017-12-24 13:22:00 +01:00
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
finish
endif
2018-09-02 21:07:30 +02:00
" save 'cpo' for restoration at the end of this file
let s:cpo_save = &cpo
set cpo&vim
2017-12-24 13:22:00 +01:00
" Don't load another plugin for this buffer
let b:did_ftplugin = 1
let b:undo_ftplugin = "setl inc< sua< commentstring<"
2017-12-24 13:22:00 +01:00
2018-09-02 21:07:30 +02: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
setlocal include=\s*include
setlocal suffixesadd=.cmake,-config.cmake
2017-12-24 13:22:00 +01:00
setlocal commentstring=#\ %s
2018-09-02 21:07:30 +02:00
" restore 'cpo' and clean up buffer variable
let &cpo = s:cpo_save
unlet s:cpo_save