aboutsummaryrefslogtreecommitdiff
path: root/vim/after/ftplugin/vim.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-04-30 13:30:30 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-04-30 13:30:30 +1200
commit19e4a5a8c4c4497ffe136f9a452b239cbf79b40e (patch)
tree5cff50d38bf96570a4b11e36cd79c4d298ac1fe2 /vim/after/ftplugin/vim.vim
parentMerge branch 'release/v4.18.0' into develop (diff)
downloaddotfiles-19e4a5a8c4c4497ffe136f9a452b239cbf79b40e.tar.gz
dotfiles-19e4a5a8c4c4497ffe136f9a452b239cbf79b40e.zip
Adjust matchit words for Vim filetype
Don't match the opening of control blocks with "return", "break", "continue" statements within; doesn't seem right to me.
Diffstat (limited to 'vim/after/ftplugin/vim.vim')
-rw-r--r--vim/after/ftplugin/vim.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/vim/after/ftplugin/vim.vim b/vim/after/ftplugin/vim.vim
index d2fa77e2..790dd38e 100644
--- a/vim/after/ftplugin/vim.vim
+++ b/vim/after/ftplugin/vim.vim
@@ -16,6 +16,18 @@ if &keywordprg !=# ':help'
let b:undo_ftplugin .= '|setlocal keywordprg<'
endif
+" Adjust the match words for the matchit plugin; the default filetype plugin
+" matches e.g. an opening "function" with the first "return" within, which I
+" don't like
+if exists('g:loaded_matchit')
+ let b:match_words =
+ \ '\<fu\%[nction]\>:\<endf\%[unction]\>,' .
+ \ '\<\(wh\%[ile]\|for\)\>:\<end\(w\%[hile]\|fo\%[r]\)\>,' .
+ \ '\<if\>:\<el\%[seif]\>:\<en\%[dif]\>,' .
+ \ '\<try\>:\<cat\%[ch]\>:\<fina\%[lly]\>:\<endt\%[ry]\>,' .
+ \ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,'
+endif
+
" Stop here if the user doesn't want ftplugin mappings
if exists('g:no_plugin_maps') || exists('g:no_vim_maps')
finish