From 87a26c5bf169bafbee837e2323f24cfb07e35250 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 21 Dec 2021 14:41:23 +0100 Subject: Update --- ftplugin/zimbu.vim | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 4 deletions(-) (limited to 'ftplugin/zimbu.vim') diff --git a/ftplugin/zimbu.vim b/ftplugin/zimbu.vim index a16fe8c0..0605d513 100644 --- a/ftplugin/zimbu.vim +++ b/ftplugin/zimbu.vim @@ -5,7 +5,7 @@ endif " Vim filetype plugin file " Language: Zimbu " Maintainer: Bram Moolenaar -" Last Change: 2017 Dec 05 +" Last Change: 2021 Nov 12 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -38,9 +38,11 @@ setlocal errorformat^=%f\ line\ %l\ col\ %c:\ %m,ERROR:\ %m " When the matchit plugin is loaded, this makes the % command skip parens and " braces in comments. -let b:match_words = '\(^\s*\)\@<=\(MODULE\|CLASS\|INTERFACE\|BITS\|ENUM\|SHARED\|FUNC\|REPLACE\|DEFINE\|PROC\|EQUAL\|MAIN\|IF\|GENERATE_IF\|WHILE\|REPEAT\|WITH\|DO\|FOR\|SWITCH\|TRY\)\>\|{\s*$:\(^\s*\)\@<=\(ELSE\|ELSEIF\|GENERATE_ELSE\|GENERATE_ELSEIF\|CATCH\|FINALLY\)\>:\(^\s*\)\@<=\(}\|\\)' - -let b:match_skip = 's:comment\|string\|zimbuchar' +if exists("loaded_matchit") && !exists("b:match_words") + let b:match_words = '\(^\s*\)\@<=\(MODULE\|CLASS\|INTERFACE\|BITS\|ENUM\|SHARED\|FUNC\|REPLACE\|DEFINE\|PROC\|EQUAL\|MAIN\|IF\|GENERATE_IF\|WHILE\|REPEAT\|WITH\|DO\|FOR\|SWITCH\|TRY\)\>\|{\s*$:\(^\s*\)\@<=\(ELSE\|ELSEIF\|GENERATE_ELSE\|GENERATE_ELSEIF\|CATCH\|FINALLY\)\>:\(^\s*\)\@<=\(}\|\\)' + let b:match_skip = 's:comment\|string\|zimbuchar' + let b:undo_ftplugin .= " | unlet! b:match_words b:match_skip" +endif setlocal tw=78 setlocal et sts=2 sw=2 @@ -139,9 +141,60 @@ iabbr until GCUpperSpace("until") iabbr while GCUpperSpace("while") iabbr repeat GCUpper("repeat") +let b:undo_ftplugin ..= + \ " | iunabbr alias" .. + \ " | iunabbr arg" .. + \ " | iunabbr break" .. + \ " | iunabbr case" .. + \ " | iunabbr catch" .. + \ " | iunabbr check" .. + \ " | iunabbr class" .. + \ " | iunabbr interface" .. + \ " | iunabbr implements" .. + \ " | iunabbr shared" .. + \ " | iunabbr continue" .. + \ " | iunabbr default" .. + \ " | iunabbr extends" .. + \ " | iunabbr do" .. + \ " | iunabbr else" .. + \ " | iunabbr elseif" .. + \ " | iunabbr enum" .. + \ " | iunabbr exit" .. + \ " | iunabbr false" .. + \ " | iunabbr fail" .. + \ " | iunabbr finally" .. + \ " | iunabbr for" .. + \ " | iunabbr func" .. + \ " | iunabbr if" .. + \ " | iunabbr import" .. + \ " | iunabbr in" .. + \ " | iunabbr io" .. + \ " | iunabbr main" .. + \ " | iunabbr module" .. + \ " | iunabbr new" .. + \ " | iunabbr nil" .. + \ " | iunabbr ok" .. + \ " | iunabbr proc" .. + \ " | iunabbr proceed" .. + \ " | iunabbr return" .. + \ " | iunabbr step" .. + \ " | iunabbr switch" .. + \ " | iunabbr sys" .. + \ " | iunabbr this" .. + \ " | iunabbr throw" .. + \ " | iunabbr try" .. + \ " | iunabbr to" .. + \ " | iunabbr true" .. + \ " | iunabbr until" .. + \ " | iunabbr while" .. + \ " | iunabbr repeat" + if !exists("no_plugin_maps") && !exists("no_zimbu_maps") nnoremap [[ m`:call ZimbuGoStartBlock() nnoremap ]] m`:call ZimbuGoEndBlock() + let b:undo_ftplugin ..= + \ " | silent! exe 'nunmap [['" .. + \ " | silent! exe 'nunmap ]]'" endif " Using a function makes sure the search pattern is restored -- cgit v1.2.3