comparison runtime/ftplugin/cmake.vim @ 35009:db548356f001

ftplugin(cmake): Add include and suffixesadd Commit: https://github.com/vim/vim/commit/564166f68184071775cffffe331a9e12241be1ac Author: Wu, Zhenyu <wuzhenyu@ustc.edu> Date: Sat Apr 20 17:53:08 2024 +0200 ftplugin(cmake): Add include and suffixesadd closes: https://github.com/vim/vim/issues/14520 Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sat, 20 Apr 2024 18:00:02 +0200
parents 34fd018452ed
children
comparison
equal deleted inserted replaced
35008:7cc562cd6332 35009:db548356f001
1 " Vim filetype plugin 1 " Vim filetype plugin
2 " Language: CMake 2 " Language: CMake
3 " Maintainer: Keith Smiley <keithbsmiley@gmail.com> 3 " Maintainer: Keith Smiley <keithbsmiley@gmail.com>
4 " Last Change: 2018 Aug 30 4 " Last Change: 2018 Aug 30
5 " 2024 Apr 20 - add include and suffixadd (Vim Project)
5 6
6 " Only do this when not done yet for this buffer 7 " Only do this when not done yet for this buffer
7 if exists("b:did_ftplugin") 8 if exists("b:did_ftplugin")
8 finish 9 finish
9 endif 10 endif
13 set cpo&vim 14 set cpo&vim
14 15
15 " Don't load another plugin for this buffer 16 " Don't load another plugin for this buffer
16 let b:did_ftplugin = 1 17 let b:did_ftplugin = 1
17 18
18 let b:undo_ftplugin = "setl commentstring<" 19 let b:undo_ftplugin = "setl inc< sua< commentstring<"
19 20
20 if exists('loaded_matchit') 21 if exists('loaded_matchit')
21 let b:match_words = '\<if\>:\<elseif\>\|\<else\>:\<endif\>' 22 let b:match_words = '\<if\>:\<elseif\>\|\<else\>:\<endif\>'
22 \ . ',\<foreach\>\|\<while\>:\<break\>:\<endforeach\>\|\<endwhile\>' 23 \ . ',\<foreach\>\|\<while\>:\<break\>:\<endforeach\>\|\<endwhile\>'
23 \ . ',\<macro\>:\<endmacro\>' 24 \ . ',\<macro\>:\<endmacro\>'
25 let b:match_ignorecase = 1 26 let b:match_ignorecase = 1
26 27
27 let b:undo_ftplugin .= "| unlet b:match_words" 28 let b:undo_ftplugin .= "| unlet b:match_words"
28 endif 29 endif
29 30
31 setlocal include=\s*include
32 setlocal suffixesadd=.cmake,-config.cmake
30 setlocal commentstring=#\ %s 33 setlocal commentstring=#\ %s
31 34
32 " restore 'cpo' and clean up buffer variable 35 " restore 'cpo' and clean up buffer variable
33 let &cpo = s:cpo_save 36 let &cpo = s:cpo_save
34 unlet s:cpo_save 37 unlet s:cpo_save