aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin/cmake.vim
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-10-30 01:01:29 +0100
committerGitHub <noreply@github.com>2018-10-30 01:01:29 +0100
commit500345aea2ef88b45e0905043ed435ad4676bcef (patch)
treec7def1cc1de8c7c869560eb9770ee6067ae1323d /runtime/ftplugin/cmake.vim
parentf5406dfe7772dca82e31f27c042c5718198f0ec8 (diff)
parent18ce6c90636abae594905eecf2e225124ae8ab17 (diff)
downloadrneovim-500345aea2ef88b45e0905043ed435ad4676bcef.tar.gz
rneovim-500345aea2ef88b45e0905043ed435ad4676bcef.tar.bz2
rneovim-500345aea2ef88b45e0905043ed435ad4676bcef.zip
Merge #9172 from justinmk/vim-d473c8c10126
Diffstat (limited to 'runtime/ftplugin/cmake.vim')
-rw-r--r--runtime/ftplugin/cmake.vim20
1 files changed, 19 insertions, 1 deletions
diff --git a/runtime/ftplugin/cmake.vim b/runtime/ftplugin/cmake.vim
index e81cd4071c..94c007629b 100644
--- a/runtime/ftplugin/cmake.vim
+++ b/runtime/ftplugin/cmake.vim
@@ -1,16 +1,34 @@
" Vim filetype plugin
" Language: CMake
" Maintainer: Keith Smiley <keithbsmiley@gmail.com>
-" Last Change: 2017 Dec 24
+" Last Change: 2018 Aug 30
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
finish
endif
+" save 'cpo' for restoration at the end of this file
+let s:cpo_save = &cpo
+set cpo&vim
+
" Don't load another plugin for this buffer
let b:did_ftplugin = 1
let b:undo_ftplugin = "setl commentstring<"
+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 commentstring=#\ %s
+
+" restore 'cpo' and clean up buffer variable
+let &cpo = s:cpo_save
+unlet s:cpo_save