From 19e4a5a8c4c4497ffe136f9a452b239cbf79b40e Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 30 Apr 2019 13:30:30 +1200 Subject: 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. --- vim/after/ftplugin/vim.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 = + \ '\:\,' . + \ '\<\(wh\%[ile]\|for\)\>:\,' . + \ '\:\:\,' . + \ '\:\:\:\,' . + \ '\\)\@!\S:\,' +endif + " Stop here if the user doesn't want ftplugin mappings if exists('g:no_plugin_maps') || exists('g:no_vim_maps') finish -- cgit v1.2.3