diff options
Diffstat (limited to 'ftplugin')
-rw-r--r-- | ftplugin/8th.vim | 10 | ||||
-rw-r--r-- | ftplugin/aap.vim | 13 | ||||
-rw-r--r-- | ftplugin/clojure.vim | 4 | ||||
-rw-r--r-- | ftplugin/diff.vim | 11 | ||||
-rw-r--r-- | ftplugin/dosini.vim | 2 | ||||
-rw-r--r-- | ftplugin/dune.vim | 4 | ||||
-rw-r--r-- | ftplugin/erlang.vim | 22 | ||||
-rw-r--r-- | ftplugin/git.vim | 45 | ||||
-rw-r--r-- | ftplugin/gitcommit.vim | 46 | ||||
-rw-r--r-- | ftplugin/gitrebase.vim | 13 | ||||
-rw-r--r-- | ftplugin/indent.vim | 7 | ||||
-rw-r--r-- | ftplugin/kotlin.vim | 21 | ||||
-rw-r--r-- | ftplugin/mail.vim | 10 | ||||
-rw-r--r-- | ftplugin/meson.vim | 23 | ||||
-rw-r--r-- | ftplugin/nginx.vim | 4 | ||||
-rw-r--r-- | ftplugin/nsis.vim | 4 | ||||
-rw-r--r-- | ftplugin/oasis.vim | 6 | ||||
-rw-r--r-- | ftplugin/ocaml.vim | 38 | ||||
-rw-r--r-- | ftplugin/ocamlbuild_tags.vim | 6 | ||||
-rw-r--r-- | ftplugin/omake.vim | 2 | ||||
-rw-r--r-- | ftplugin/ruby.vim | 40 | ||||
-rw-r--r-- | ftplugin/sexplib.vim | 2 | ||||
-rw-r--r-- | ftplugin/systemverilog.vim | 2 | ||||
-rw-r--r-- | ftplugin/toml.vim | 14 | ||||
-rw-r--r-- | ftplugin/unison.vim | 11 | ||||
-rw-r--r-- | ftplugin/vb.vim | 82 | ||||
-rw-r--r-- | ftplugin/zig.vim | 8 | ||||
-rw-r--r-- | ftplugin/zimbu.vim | 61 |
28 files changed, 339 insertions, 172 deletions
diff --git a/ftplugin/8th.vim b/ftplugin/8th.vim index e9a63dc1..c7dce2b3 100644 --- a/ftplugin/8th.vim +++ b/ftplugin/8th.vim @@ -5,9 +5,10 @@ endif " Vim ftplugin file " Language: 8th " Version: any -" Last Change: 2015/11/08 +" Last Change: 2021 Sep 20 +" Last Change: 2021/09/20 " Maintainer: Ron Aaron <ron@aaron-tech.com> -" URL: https://8th-dev.com/ +" URL: https://8th-dev.com/ " Filetypes: *.8th " NOTE: 8th allows any non-whitespace in a name, so you need to do: " setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255 @@ -18,12 +19,13 @@ if exists("b:did_8thplugin") finish endif -" Don't load another plugin for this buffer +" Don't load another 8th plugin for this buffer let b:did_8thplugin = 1 setlocal ts=2 sts=2 sw=2 et -setlocal com=s1:/*,mb:*,ex:*/,:\|,:\\ +setlocal com=s1:/*,mb:*,ex:*/,b:--,be:\\ setlocal fo=tcrqol setlocal matchpairs+=\::; setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255 setlocal suffixesadd=.8th +let b:undo_ftplugin = "setlocal ts< sts< sw< et< com< fo< mps< isk< sua<" diff --git a/ftplugin/aap.vim b/ftplugin/aap.vim index 3a8f1cbb..40f4597b 100644 --- a/ftplugin/aap.vim +++ b/ftplugin/aap.vim @@ -5,7 +5,7 @@ endif " Vim filetype plugin file " Language: Aap recipe " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2013 Apr 05 +" Last Change: 2021 Nov 14 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -15,8 +15,9 @@ endif " Don't load another plugin for this buffer let b:did_ftplugin = 1 -" Reset 'formatoptions', 'comments' and 'expandtab' to undo this plugin. -let b:undo_ftplugin = "setl fo< com< et<" +" Reset 'formatoptions', 'comments', 'commentstring' and 'expandtab' to undo +" this plugin. +let b:undo_ftplugin = "setl fo< com< cms< et<" " Set 'formatoptions' to break comment lines but not other lines, " and insert the comment leader when hitting <CR> or using "o". @@ -24,6 +25,12 @@ setlocal fo-=t fo+=croql " Set 'comments' to format dashed lists in comments. setlocal comments=s:#\ -,m:#\ \ ,e:#,n:#,fb:- +setlocal commentstring=#\ %s " Expand tabs to spaces to avoid trouble. setlocal expandtab + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Aap Recipe Files (*.aap)\t*.aap\nAll Files (*.*)\t*.*\n" + let b:undo_ftplugin .= " | unlet! b:browsefilter" +endif diff --git a/ftplugin/clojure.vim b/ftplugin/clojure.vim index 2c2882e3..7fe81f9d 100644 --- a/ftplugin/clojure.vim +++ b/ftplugin/clojure.vim @@ -68,8 +68,8 @@ if exists('loaded_matchit') let b:undo_ftplugin .= ' | unlet! b:match_words b:match_skip' endif -" Win32 can filter files in the browse dialog -if has("gui_win32") && !exists("b:browsefilter") +" Filter files in the browse dialog +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter = "Clojure Source Files (*.clj)\t*.clj\n" . \ "ClojureScript Source Files (*.cljs)\t*.cljs\n" . \ "Java Source Files (*.java)\t*.java\n" . diff --git a/ftplugin/diff.vim b/ftplugin/diff.vim index c7d8cefc..feaefc57 100644 --- a/ftplugin/diff.vim +++ b/ftplugin/diff.vim @@ -5,7 +5,7 @@ endif " Vim filetype plugin file " Language: Diff " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2020 Jul 18 +" Last Change: 2021 Nov 14 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -13,10 +13,15 @@ if exists("b:did_ftplugin") endif let b:did_ftplugin = 1 -let b:undo_ftplugin = "setl modeline<" +let b:undo_ftplugin = "setl modeline< commentstring<" " Don't use modelines in a diff, they apply to the diffed file setlocal nomodeline " If there are comments they start with # -let &commentstring = "# %s" +let &l:commentstring = "# %s" + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Diff Files (*.diff)\t*.diff\nPatch Files (*.patch)\t*.h\nAll Files (*.*)\t*.*\n" + let b:undo_ftplugin .= " | unlet! b:browsefilter" +endif diff --git a/ftplugin/dosini.vim b/ftplugin/dosini.vim index fc739a01..5ee9a5e0 100644 --- a/ftplugin/dosini.vim +++ b/ftplugin/dosini.vim @@ -3,7 +3,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'dosini', 'ftplugin/dosini.vim endif " Vim filetype plugin file -" Language: Configuration File (ini file) for MSDOS/MS Windows +" Language: Configuration File (ini file) for MS-DOS/MS Windows " Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Latest Revision: 2008-07-09 diff --git a/ftplugin/dune.vim b/ftplugin/dune.vim index 4f78d7c6..c89e40d2 100644 --- a/ftplugin/dune.vim +++ b/ftplugin/dune.vim @@ -15,10 +15,12 @@ if exists("b:did_ftplugin") endif let b:did_ftplugin=1 -set lisp +setl lisp " Comment string setl commentstring=;\ %s setl comments=n:; setl iskeyword+=#,?,.,/ + +let b:undo_ftplugin = "setlocal lisp< cms< com< isk<" diff --git a/ftplugin/erlang.vim b/ftplugin/erlang.vim index 798f1ded..85f57209 100644 --- a/ftplugin/erlang.vim +++ b/ftplugin/erlang.vim @@ -34,6 +34,28 @@ setlocal commentstring=%%s setlocal formatoptions+=ro +if get(g:, 'erlang_extend_path', 1) + " typical erlang.mk paths + let &l:path = join([ + \ 'deps/*/include', + \ 'deps/*/src', + \ 'deps/*/test', + \ 'deps/*/apps/*/include', + \ 'deps/*/apps/*/src', + \ &g:path], ',') + " typical rebar3 paths + let &l:path = join([ + \ 'apps/*/include', + \ 'apps/*/src', + \ '_build/default/lib/*/src', + \ '_build/default/*/include', + \ &l:path], ',') + " typical erlang paths + let &l:path = join(['include', 'src', 'test', &l:path], ',') + + set wildignore+=*/.erlang.mk/*,*.beam +endif + setlocal suffixesadd=.erl,.hrl let &l:include = '^\s*-\%(include\|include_lib\)\s*("\zs\f*\ze")' diff --git a/ftplugin/git.vim b/ftplugin/git.vim deleted file mode 100644 index 9a5ac16c..00000000 --- a/ftplugin/git.vim +++ /dev/null @@ -1,45 +0,0 @@ -if polyglot#init#is_disabled(expand('<sfile>:p'), 'git', 'ftplugin/git.vim') - finish -endif - -" Vim filetype plugin -" Language: generic git output -" Maintainer: Tim Pope <vimNOSPAM@tpope.org> -" Last Change: 2019 Dec 05 - -" Only do this when not done yet for this buffer -if (exists("b:did_ftplugin")) - finish -endif -let b:did_ftplugin = 1 - -if !exists('b:git_dir') - if expand('%:p') =~# '[\/]\.git[\/]modules[\/]\|:[\/][\/]\|^\a\a\+:' - " Stay out of the way - elseif expand('%:p') =~# '[\/]\.git[\/]worktrees' - let b:git_dir = matchstr(expand('%:p'),'.*\.git[\/]worktrees[\/][^\/]\+\>') - elseif expand('%:p') =~# '\.git\>' - let b:git_dir = matchstr(expand('%:p'),'.*\.git\>') - elseif $GIT_DIR != '' - let b:git_dir = $GIT_DIR - endif - if (has('win32') || has('win64')) && exists('b:git_dir') - let b:git_dir = substitute(b:git_dir,'\\','/','g') - endif -endif - -if exists('*shellescape') && exists('b:git_dir') && b:git_dir != '' - if b:git_dir =~# '/\.git$' " Not a bare repository - let &l:path = escape(fnamemodify(b:git_dir,':h'),'\, ').','.&l:path - endif - let &l:path = escape(b:git_dir,'\, ').','.&l:path - let &l:keywordprg = 'git --git-dir='.shellescape(b:git_dir).' show' -else - setlocal keywordprg=git\ show -endif -if has('gui_running') && &guioptions !~# '!' - let &l:keywordprg = substitute(&l:keywordprg,'^git\>','git --no-pager','') -endif - -setlocal includeexpr=substitute(v:fname,'^[^/]\\+/','','') -let b:undo_ftplugin = "setl keywordprg< path< includeexpr<" diff --git a/ftplugin/gitcommit.vim b/ftplugin/gitcommit.vim index caa96db8..56e72973 100644 --- a/ftplugin/gitcommit.vim +++ b/ftplugin/gitcommit.vim @@ -12,60 +12,50 @@ if (exists("b:did_ftplugin")) finish endif -runtime! ftplugin/git.vim let b:did_ftplugin = 1 -setlocal comments=:# commentstring=#\ %s -setlocal include=^\+\+\+ setlocal nomodeline tabstop=8 formatoptions+=tl textwidth=72 setlocal formatoptions-=c formatoptions-=r formatoptions-=o formatoptions-=q formatoptions+=n setlocal formatlistpat+=\\\|^\\s*[-*+]\\s\\+ +setlocal include=^+++ +setlocal includeexpr=substitute(v:fname,'^[bi]/','','') -let b:undo_ftplugin = 'setl modeline< tabstop< formatoptions< tw< com< cms< formatlistpat<' +let b:undo_ftplugin = 'setl modeline< tabstop< formatoptions< tw< com< cms< formatlistpat< inc< inex<' -if exists("g:no_gitcommit_commands") || v:version < 700 - finish -endif +let s:l = search('\C\m^[#;@!$%^&|:] -\{24,\} >8 -\{24,\}$', 'cnW', '', 100) +let &l:comments = ':' . (matchstr(getline(s:l ? s:l : '$'), '^[#;@!$%^&|:]\S\@!') . '#')[0] +let &l:commentstring = &l:comments[1] . ' %s' +unlet s:l -if !exists("b:git_dir") - let b:git_dir = expand("%:p:h") +if exists("g:no_gitcommit_commands") + finish endif -command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(<bang>0,b:git_dir,<f-args>) +command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(<bang>0, <f-args>) let b:undo_ftplugin = b:undo_ftplugin . "|delc DiffGitCached" -function! s:diffcomplete(A,L,P) +function! s:diffcomplete(A, L, P) abort let args = "" if a:P <= match(a:L." -- "," -- ")+3 let args = args . "-p\n--stat\n--shortstat\n--summary\n--patch-with-stat\n--no-renames\n-B\n-M\n-C\n" end - if exists("b:git_dir") && a:A !~ '^-' - let tree = fnamemodify(b:git_dir,':h') - if strpart(getcwd(),0,strlen(tree)) == tree - let args = args."\n".system("git diff --cached --name-only") - endif + if a:A !~ '^-' && !empty(getftype('.git')) + let args = args."\n".system("git diff --cached --name-only") endif return args endfunction -function! s:gitdiffcached(bang,gitdir,...) - let tree = fnamemodify(a:gitdir,':h') +function! s:gitdiffcached(bang, ...) abort let name = tempname() - let git = "git" - if strpart(getcwd(),0,strlen(tree)) != tree - let git .= " --git-dir=".(exists("*shellescape") ? shellescape(a:gitdir) : '"'.a:gitdir.'"') - endif if a:0 - let extra = join(map(copy(a:000),exists("*shellescape") ? 'shellescape(v:val)' : "'\"'.v:val.'\"'")) + let extra = join(map(copy(a:000), 'shellescape(v:val)')) else let extra = "-p --stat=".&columns endif - call system(git." diff --cached --no-color --no-ext-diff ".extra." > ".(exists("*shellescape") ? shellescape(name) : name)) - exe "pedit ".(exists("*fnameescape") ? fnameescape(name) : name) + call system("git diff --cached --no-color --no-ext-diff ".extra." > ".shellescape(name)) + exe "pedit " . fnameescape(name) wincmd P - let b:git_dir = a:gitdir - command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(<bang>0,b:git_dir,<f-args>) - nnoremap <buffer> <silent> q :q<CR> + command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(<bang>0, <f-args>) setlocal buftype=nowrite nobuflisted noswapfile nomodifiable filetype=git endfunction diff --git a/ftplugin/gitrebase.vim b/ftplugin/gitrebase.vim index 7163f916..285f76a4 100644 --- a/ftplugin/gitrebase.vim +++ b/ftplugin/gitrebase.vim @@ -12,15 +12,13 @@ if (exists("b:did_ftplugin")) finish endif -runtime! ftplugin/git.vim let b:did_ftplugin = 1 -setlocal comments=:# commentstring=#\ %s formatoptions-=t +let &l:comments = ':' . (matchstr(getline('$'), '^[#;@!$%^&|:]\S\@!') . '#')[0] +let &l:commentstring = &l:comments[1] . ' %s' +setlocal formatoptions-=t setlocal nomodeline -if !exists("b:undo_ftplugin") - let b:undo_ftplugin = "" -endif -let b:undo_ftplugin = b:undo_ftplugin."|setl com< cms< fo< ml<" +let b:undo_ftplugin = "setl com< cms< fo< ml<" function! s:choose(word) abort s/^\(\w\+\>\)\=\(\s*\)\ze\x\{4,40\}\>/\=(strlen(submatch(1)) == 1 ? a:word[0] : a:word) . substitute(submatch(2),'^$',' ','')/e @@ -45,8 +43,7 @@ if exists("g:no_plugin_maps") || exists("g:no_gitrebase_maps") finish endif -nnoremap <buffer> <expr> K col('.') < 7 && expand('<Lt>cword>') =~ '\X' && getline('.') =~ '^\w\+\s\+\x\+\>' ? 'wK' : 'K' nnoremap <buffer> <silent> <C-A> :<C-U><C-R>=v:count1<CR>Cycle<CR> nnoremap <buffer> <silent> <C-X> :<C-U><C-R>=v:count1<CR>Cycle!<CR> -let b:undo_ftplugin = b:undo_ftplugin . "|exe 'nunmap <buffer> K'|exe 'nunmap <buffer> <C-A>'|exe 'nunmap <buffer> <C-X>'" +let b:undo_ftplugin = b:undo_ftplugin . "|exe 'nunmap <buffer> <C-A>'|exe 'nunmap <buffer> <C-X>'" diff --git a/ftplugin/indent.vim b/ftplugin/indent.vim index 89a779c4..094dcd9e 100644 --- a/ftplugin/indent.vim +++ b/ftplugin/indent.vim @@ -3,9 +3,10 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'indent', 'ftplugin/indent.vim endif " Vim filetype plugin file -" Language: indent(1) configuration file -" Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2008-07-09 +" Language: indent(1) configuration file +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish diff --git a/ftplugin/kotlin.vim b/ftplugin/kotlin.vim index ca0b35fc..e6677fdf 100644 --- a/ftplugin/kotlin.vim +++ b/ftplugin/kotlin.vim @@ -2,8 +2,29 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'kotlin', 'ftplugin/kotlin.vim finish endif +" Vim filetype plugin file +" Language: Kotlin +" Maintainer: Alexander Udalov +" URL: https://github.com/udalov/kotlin-vim +" Last Change: 7 November 2021 + if exists('b:did_ftplugin') | finish | endif let b:did_ftplugin = 1 +let s:save_cpo = &cpo +set cpo&vim + setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// setlocal commentstring=//\ %s + +setlocal formatoptions-=t formatoptions+=croqnl +silent! setlocal formatoptions+=j + +setlocal includeexpr=substitute(v:fname,'\\.','/','g') +setlocal suffixesadd=.kt + +let b:undo_ftplugin = "setlocal comments< commentstring< ". + \ "formatoptions< includeexpr< suffixesadd<" + +let &cpo = s:save_cpo +unlet s:save_cpo diff --git a/ftplugin/mail.vim b/ftplugin/mail.vim index 6e4e9a4f..e621acca 100644 --- a/ftplugin/mail.vim +++ b/ftplugin/mail.vim @@ -5,7 +5,7 @@ endif " Vim filetype plugin file " Language: Mail " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2012 Nov 20 +" Last Change: 2021 Oct 23 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -30,6 +30,14 @@ setlocal fo+=tcql " Add n:> to 'comments, in case it was removed elsewhere setlocal comments+=n:> +" .eml files are universally formatted with DOS line-endings, per RFC5322. +" If the file was not DOS the it will be marked as changed, which is probably +" a good thing. +if expand('%:e') ==? 'eml' + let b:undo_ftplugin .= " fileformat=" .. &fileformat + setlocal fileformat=dos +endif + " Add mappings, unless the user doesn't want this. if !exists("no_plugin_maps") && !exists("no_mail_maps") " Quote text by inserting "> " diff --git a/ftplugin/meson.vim b/ftplugin/meson.vim index 79ff47c6..a3608522 100644 --- a/ftplugin/meson.vim +++ b/ftplugin/meson.vim @@ -16,9 +16,28 @@ set cpo&vim setlocal commentstring=#\ %s setlocal comments=:# +setlocal formatoptions+=croql formatoptions-=t -setlocal shiftwidth=2 -setlocal softtabstop=2 +let b:undo_ftplugin = "setl com< cms< fo<" + +if get(g:, "meson_recommended_style", 1) + setlocal expandtab + setlocal shiftwidth=2 + setlocal softtabstop=2 + let b:undo_ftplugin .= " | setl et< sts< sw<" +endif + +if exists("loaded_matchit") && !exists("b:match_words") + let b:match_words = '\<if\>:\<elif\>:\<else\>:\<endif\>,' . + \ '\<foreach\>:\<break\>:\<continue\>:\<endforeach\>' + let b:undo_ftplugin .= " | unlet! b:match_words" +endif + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Meson Build Files (meson.build)\tmeson.build\n" . + \ "All Files (*.*)\t*.*\n" + let b:undo_ftplugin .= " | unlet! b:browsefilter" +endif let &cpo = s:keepcpo unlet s:keepcpo diff --git a/ftplugin/nginx.vim b/ftplugin/nginx.vim index 45442242..61b8a760 100644 --- a/ftplugin/nginx.vim +++ b/ftplugin/nginx.vim @@ -2,4 +2,8 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'nginx', 'ftplugin/nginx.vim') finish endif +setlocal comments=:# setlocal commentstring=#\ %s +setlocal formatoptions+=croql formatoptions-=t + +let b:undo_ftplugin = "setl fo< cms< com<" diff --git a/ftplugin/nsis.vim b/ftplugin/nsis.vim index ab54e5d3..2a387b4a 100644 --- a/ftplugin/nsis.vim +++ b/ftplugin/nsis.vim @@ -7,7 +7,7 @@ endif " Maintainer: Ken Takata " URL: https://github.com/k-takata/vim-nsis " Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Last Change: 2018-01-26 +" Last Change: 2021-10-18 if exists("b:did_ftplugin") finish @@ -19,7 +19,6 @@ set cpo&vim let b:did_ftplugin = 1 let b:undo_ftplugin = "setl com< cms< fo< def< inc<" - \ " | unlet! b:match_ignorecase b:match_words" setlocal comments=s1:/*,mb:*,ex:*/,b:#,:; commentstring=;\ %s setlocal formatoptions-=t formatoptions+=croql @@ -41,6 +40,7 @@ if exists("loaded_matchit") \ '\${MementoSection}:\${MementoSectionEnd},' . \ '!if\%(\%(macro\)\?n\?def\)\?\>:!else\>:!endif\>,' . \ '!macro\>:!macroend\>' + let b:undo_ftplugin .= " | unlet! b:match_ignorecase b:match_words" endif let &cpo = s:cpo_save diff --git a/ftplugin/oasis.vim b/ftplugin/oasis.vim index ad7dd1a5..7c5771db 100644 --- a/ftplugin/oasis.vim +++ b/ftplugin/oasis.vim @@ -2,6 +2,12 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'ocaml', 'ftplugin/oasis.vim') finish endif +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin=1 setlocal comments=:# setlocal commentstring=#\ %s + +let b:undo_ftplugin = "com< cms<" diff --git a/ftplugin/ocaml.vim b/ftplugin/ocaml.vim index 6ce2adcb..858e4fd4 100644 --- a/ftplugin/ocaml.vim +++ b/ftplugin/ocaml.vim @@ -46,6 +46,8 @@ setlocal comments=sr:(*\ ,mb:\ ,ex:*) setlocal comments^=sr:(**,mb:\ \ ,ex:*) setlocal commentstring=(*%s*) +let b:undo_ftplugin = "setlocal com< cms<" + " Add mappings, unless the user didn't want this. if !exists("no_plugin_maps") && !exists("no_ocaml_maps") " (un)commenting @@ -54,6 +56,11 @@ if !exists("no_plugin_maps") && !exists("no_ocaml_maps") xmap <buffer> <LocalLeader>c <Plug>BUncomOn nmap <buffer> <LocalLeader>C <Plug>LUncomOff xmap <buffer> <LocalLeader>C <Plug>BUncomOff + let b:undo_ftplugin .= + \ " | silent! execute 'nunmap <buffer> <LocalLeader>c'" . + \ " | silent! execute 'xunmap <buffer> <LocalLeader>c'" . + \ " | silent! execute 'nunmap <buffer> <LocalLeader>C'" . + \ " | silent! execute 'xunmap <buffer> <LocalLeader>C'" endif nnoremap <buffer> <Plug>LUncomOn gI(* <End> *)<ESC> @@ -66,17 +73,27 @@ if !exists("no_plugin_maps") && !exists("no_ocaml_maps") nmap <buffer> <LocalLeader>t <Plug>OCamlPrintType xmap <buffer> <LocalLeader>t <Plug>OCamlPrintType + + let b:undo_ftplugin .= + \ " | silent! execute 'nunmap <buffer> <LocalLeader>s'" . + \ " | silent! execute 'nunmap <buffer> <LocalLeader>S'" . + \ " | silent! execute 'nunmap <buffer> <LocalLeader>t'" . + \ " | silent! execute 'xunmap <buffer> <LocalLeader>t'" endif -" Let % jump between structure elements (due to Issac Trotts) -let b:mw = '\<let\>:\<and\>:\(\<in\>\|;;\)' -let b:mw = b:mw . ',\<if\>:\<then\>:\<else\>' -let b:mw = b:mw . ',\<\(for\|while\)\>:\<do\>:\<done\>' -let b:mw = b:mw . ',\<\(object\|sig\|struct\|begin\)\>:\<end\>' -let b:mw = b:mw . ',\<\(match\|try\)\>:\<with\>' -let b:match_words = b:mw +if exists("loaded_matchit") && !exists("b:match_words") + " Let % jump between structure elements (due to Issac Trotts) + let b:mw = '\<let\>:\<and\>:\(\<in\>\|;;\)' + let b:mw = b:mw . ',\<if\>:\<then\>:\<else\>' + let b:mw = b:mw . ',\<\(for\|while\)\>:\<do\>:\<done\>' + let b:mw = b:mw . ',\<\(object\|sig\|struct\|begin\)\>:\<end\>' + let b:mw = b:mw . ',\<\(match\|try\)\>:\<with\>' + let b:match_words = b:mw + + let b:match_ignorecase=0 -let b:match_ignorecase=0 + let b:undo_ftplugin .= " | unlet! b:match_ignorecase b:match_words" +endif function! s:OcpGrep(bang,args) abort let grepprg = &l:grepprg @@ -154,12 +171,9 @@ endif if exists("g:ocaml_folding") setlocal foldmethod=expr setlocal foldexpr=OMLetFoldLevel(v:lnum) + let b:undo_ftplugin .= " | setlocal fdm< fde<" endif -let b:undo_ftplugin = "setlocal efm< foldmethod< foldexpr<" - \ . "| unlet! b:mw b:match_words b:match_ignorecase" - - " - Only definitions below, executed once ------------------------------------- if exists("*OMLetFoldLevel") diff --git a/ftplugin/ocamlbuild_tags.vim b/ftplugin/ocamlbuild_tags.vim index 5e83406d..5eecc1ce 100644 --- a/ftplugin/ocamlbuild_tags.vim +++ b/ftplugin/ocamlbuild_tags.vim @@ -2,6 +2,12 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'ocaml', 'ftplugin/ocamlbuild_ finish endif +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin=1 setlocal comments=:# setlocal commentstring=#\ %s + +let b:undo_ftplugin = "com< cms<" diff --git a/ftplugin/omake.vim b/ftplugin/omake.vim index 59e11101..fe99ea15 100644 --- a/ftplugin/omake.vim +++ b/ftplugin/omake.vim @@ -26,3 +26,5 @@ setlocal expandtab " Including files. let &l:include = '^\s*include' + +let b:undo_ftplugin = "fo< com< cms< et< inc<" diff --git a/ftplugin/ruby.vim b/ftplugin/ruby.vim index 1c6f828f..fcf346a0 100644 --- a/ftplugin/ruby.vim +++ b/ftplugin/ruby.vim @@ -90,8 +90,14 @@ endfunction function! s:build_path(path) abort let path = join(map(copy(a:path), 'v:val ==# "." ? "" : v:val'), ',') - if &g:path !~# '\v^%(\.,)=%(/%(usr|emx)/include,)=,$' - let path = substitute(&g:path,',,$',',','') . ',' . path + if &g:path =~# '\v^%(\.,)=%(/%(usr|emx)/include,)=,$' + let path = path . ',.,,' + elseif &g:path =~# ',\.,,$' + let path = &g:path[0:-4] . path . ',.,,' + elseif &g:path =~# ',,$' + let path = &g:path[0:-2] . path . ',,' + else + let path = substitute(&g:path, '[^,]\zs$', ',', '') . path endif return path endfunction @@ -167,6 +173,8 @@ let b:undo_ftplugin .= "| sil! cunmap <buffer> <Plug><ctag>| sil! cunmap <buffer if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps") nmap <buffer><script> <SID>: :<C-U> nmap <buffer><script> <SID>c: :<C-U><C-R>=v:count ? v:count : ''<CR> + cmap <buffer> <SID><cfile> <Plug><cfile> + cmap <buffer> <SID><ctag> <Plug><ctag> nnoremap <silent> <buffer> [m :<C-U>call <SID>searchsyn('\<def\>',['rubyDefine'],'b','n')<CR> nnoremap <silent> <buffer> ]m :<C-U>call <SID>searchsyn('\<def\>',['rubyDefine'],'','n')<CR> @@ -213,20 +221,20 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps") call s:map('c', '', '<C-R><C-F> <Plug><cfile>') cmap <buffer><script><expr> <SID>tagzv &foldopen =~# 'tag' ? '<Bar>norm! zv' : '' - call s:map('n', '<silent>', '<C-]> <SID>:exe v:count1."tag <Plug><ctag>"<SID>tagzv<CR>') - call s:map('n', '<silent>', 'g<C-]> <SID>:exe "tjump <Plug><ctag>"<SID>tagzv<CR>') - call s:map('n', '<silent>', 'g] <SID>:exe "tselect <Plug><ctag>"<SID>tagzv<CR>') - call s:map('n', '<silent>', '<C-W>] <SID>:exe v:count1."stag <Plug><ctag>"<SID>tagzv<CR>') - call s:map('n', '<silent>', '<C-W><C-]> <SID>:exe v:count1."stag <Plug><ctag>"<SID>tagzv<CR>') - call s:map('n', '<silent>', '<C-W>g<C-]> <SID>:exe "stjump <Plug><ctag>"<SID>tagzv<CR>') - call s:map('n', '<silent>', '<C-W>g] <SID>:exe "stselect <Plug><ctag>"<SID>tagzv<CR>') - call s:map('n', '<silent>', '<C-W>} <SID>:exe v:count1."ptag <Plug><ctag>"<CR>') - call s:map('n', '<silent>', '<C-W>g} <SID>:exe "ptjump <Plug><ctag>"<CR>') - - call s:map('n', '<silent>', 'gf <SID>c:find <Plug><cfile><CR>') - call s:map('n', '<silent>', '<C-W>f <SID>c:sfind <Plug><cfile><CR>') - call s:map('n', '<silent>', '<C-W><C-F> <SID>c:sfind <Plug><cfile><CR>') - call s:map('n', '<silent>', '<C-W>gf <SID>c:tabfind <Plug><cfile><CR>') + call s:map('n', '<script><silent>', '<C-]> <SID>:exe v:count1."tag <SID><ctag>"<SID>tagzv<CR>') + call s:map('n', '<script><silent>', 'g<C-]> <SID>:exe "tjump <SID><ctag>"<SID>tagzv<CR>') + call s:map('n', '<script><silent>', 'g] <SID>:exe "tselect <SID><ctag>"<SID>tagzv<CR>') + call s:map('n', '<script><silent>', '<C-W>] <SID>:exe v:count1."stag <SID><ctag>"<SID>tagzv<CR>') + call s:map('n', '<script><silent>', '<C-W><C-]> <SID>:exe v:count1."stag <SID><ctag>"<SID>tagzv<CR>') + call s:map('n', '<script><silent>', '<C-W>g<C-]> <SID>:exe "stjump <SID><ctag>"<SID>tagzv<CR>') + call s:map('n', '<script><silent>', '<C-W>g] <SID>:exe "stselect <SID><ctag>"<SID>tagzv<CR>') + call s:map('n', '<script><silent>', '<C-W>} <SID>:exe v:count1."ptag <SID><ctag>"<CR>') + call s:map('n', '<script><silent>', '<C-W>g} <SID>:exe "ptjump <SID><ctag>"<CR>') + + call s:map('n', '<script><silent>', 'gf <SID>c:find <SID><cfile><CR>') + call s:map('n', '<script><silent>', '<C-W>f <SID>c:sfind <SID><cfile><CR>') + call s:map('n', '<script><silent>', '<C-W><C-F> <SID>c:sfind <SID><cfile><CR>') + call s:map('n', '<script><silent>', '<C-W>gf <SID>c:tabfind <SID><cfile><CR>') endif let &cpo = s:cpo_save diff --git a/ftplugin/sexplib.vim b/ftplugin/sexplib.vim index 976e3897..74a00e54 100644 --- a/ftplugin/sexplib.vim +++ b/ftplugin/sexplib.vim @@ -17,3 +17,5 @@ let b:did_ftplugin=1 " Comment string setl commentstring=;\ %s setl comments=n:; + +let b:undo_ftplugin = "setl cms< com<" diff --git a/ftplugin/systemverilog.vim b/ftplugin/systemverilog.vim index 53bd1351..6db92d88 100644 --- a/ftplugin/systemverilog.vim +++ b/ftplugin/systemverilog.vim @@ -36,7 +36,7 @@ if exists("loaded_matchit") \ '\<checker\>:\<endchecker\>,' . \ '\<class\>:\<endclass\>,' . \ '\<clocking\>:\<endclocking\>,' . - \ '\<gruop\>:\<endgruop\>,' . + \ '\<group\>:\<endgroup\>,' . \ '\<interface\>:\<endinterface\>,' . \ '\<package\>:\<endpackage\>,' . \ '\<program\>:\<endprogram\>,' . diff --git a/ftplugin/toml.vim b/ftplugin/toml.vim index 8d45ea77..689b016c 100644 --- a/ftplugin/toml.vim +++ b/ftplugin/toml.vim @@ -2,13 +2,15 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'toml', 'ftplugin/toml.vim') finish endif -" File: ftplugin/toml.vim -" Author: Kevin Ballard <kevin@sb.org> -" Description: FileType Plugin for Toml -" Last Change: Feb 12, 2019 +" Vim filetype plugin +" Language: TOML +" Homepage: https://github.com/cespare/vim-toml +" Maintainer: Aman Verma +" Author: Kevin Ballard <kevin@sb.org> +" Last Change: Sep 21, 2021 if exists('b:did_ftplugin') - finish + finish endif let b:did_ftplugin = 1 @@ -22,4 +24,4 @@ setlocal comments=:# let &cpo = s:save_cpo unlet s:save_cpo -" vim: set et sw=4 ts=4: +" vim: et sw=2 sts=2 diff --git a/ftplugin/unison.vim b/ftplugin/unison.vim new file mode 100644 index 00000000..93ac81d6 --- /dev/null +++ b/ftplugin/unison.vim @@ -0,0 +1,11 @@ +if polyglot#init#is_disabled(expand('<sfile>:p'), 'unison', 'ftplugin/unison.vim') + finish +endif + +" Only do this when not done yet for this buffer +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +call unison#SetBufferDefaults() diff --git a/ftplugin/vb.vim b/ftplugin/vb.vim index 0b5763f2..36c2a9f1 100644 --- a/ftplugin/vb.vim +++ b/ftplugin/vb.vim @@ -3,46 +3,72 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'visual-basic', 'ftplugin/vb.v endif " Vim filetype plugin file -" Language: VisualBasic (ft=vb) -" Maintainer: Johannes Zellner <johannes@zellner.org> -" Last Change: Thu, 22 Nov 2001 12:56:14 W. Europe Standard Time +" Language: Visual Basic (ft=vb) +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Johannes Zellner <johannes@zellner.org> +" Last Change: 2021 Nov 17 -if exists("b:did_ftplugin") | finish | endif +if exists("b:did_ftplugin") + finish +endif let b:did_ftplugin = 1 -setlocal com=sr:'\ -,mb:'\ \ ,el:'\ \ ,:' +let s:cpo_save = &cpo +set cpo&vim + +setlocal comments=sr:'\ -,mb:'\ \ ,el:'\ \ ,:' +setlocal commentstring='\ %s +setlocal formatoptions-=t formatoptions+=croql + +let b:undo_ftplugin = "setlocal com< cms< fo<" " we need this wrapper, as call doesn't allow a count -fun! <SID>VbSearch(pattern, flags) +function! s:VbSearch(pattern, flags) let cnt = v:count1 while cnt > 0 call search(a:pattern, a:flags) let cnt = cnt - 1 endwhile -endfun +endfunction -let s:cpo_save = &cpo -set cpo&vim +if !exists("no_plugin_maps") && !exists("no_vb_maps") + nnoremap <buffer> <silent> [[ <Cmd>call <SID>VbSearch('^\s*\%(\%(private\<Bar>public\)\s\+\)\=\%(function\<Bar>sub\)', 'sbW')<CR> + vnoremap <buffer> <silent> [[ <Cmd>call <SID>VbSearch('^\s*\%(\%(private\<Bar>public\)\s\+\)\=\%(function\<Bar>sub\)', 'sbW')<CR> + nnoremap <buffer> <silent> ]] <Cmd>call <SID>VbSearch('^\s*\%(\%(private\<Bar>public\)\s\+\)\=\%(function\<Bar>sub\)', 'sW')<CR> + vnoremap <buffer> <silent> ]] <Cmd>call <SID>VbSearch('^\s*\%(\%(private\<Bar>public\)\s\+\)\=\%(function\<Bar>sub\)', 'sW')<CR> + nnoremap <buffer> <silent> [] <Cmd>call <SID>VbSearch('^\s*end\s\+\%(function\<Bar>sub\)', 'sbW')<CR> + vnoremap <buffer> <silent> [] <Cmd>call <SID>VbSearch('^\s*end\s\+\%(function\<Bar>sub\)', 'sbW')<CR> + nnoremap <buffer> <silent> ][ <Cmd>call <SID>VbSearch('^\s*end\s\+\%(function\<Bar>sub\)', 'sW')<CR> + vnoremap <buffer> <silent> ][ <Cmd>call <SID>VbSearch('^\s*end\s\+\%(function\<Bar>sub\)', 'sW')<CR> + let b:undo_ftplugin .= " | sil! exe 'nunmap <buffer> [[' | sil! exe 'vunmap <buffer> [['" . + \ " | sil! exe 'nunmap <buffer> ]]' | sil! exe 'vunmap <buffer> ]]'" . + \ " | sil! exe 'nunmap <buffer> []' | sil! exe 'vunmap <buffer> []'" . + \ " | sil! exe 'nunmap <buffer> ][' | sil! exe 'vunmap <buffer> ]['" +endif + +" TODO: line start anchors are almost certainly overly restrictive - allow +" after statement separators. Even in QuickBasic only block IF statements +" were required to be at the start of a line. +if exists("loaded_matchit") && !exists("b:match_words") + let b:match_ignorecase = 1 + let b:match_words = + \ '\%(^\s*\)\@<=\<if\>.*\<then\>\s*\%($\|''\):\%(^\s*\)\@<=\<else\>:\%(^\s*\)\@<=\<elseif\>:\%(^\s*\)\@<=\<end\>\s\+\<if\>,' . + \ '\%(^\s*\)\@<=\<for\>:\%(^\s*\)\@<=\<next\>,' . + \ '\%(^\s*\)\@<=\<while\>:\%(^\s*\)\@<=\<wend\>,' . + \ '\%(^\s*\)\@<=\<do\>:\%(^\s*\)\@<=\<loop\>\s\+\<while\>,' . + \ '\%(^\s*\)\@<=\<select\>\s\+\<case\>:\%(^\s*\)\@<=\<case\>:\%(^\s*\)\@<=\<end\>\s\+\<select\>,' . + \ '\%(^\s*\)\@<=\<enum\>:\%(^\s*\)\@<=\<end\>\s\<enum\>,' . + \ '\%(^\s*\)\@<=\<with\>:\%(^\s*\)\@<=\<end\>\s\<with\>,' . + \ '\%(^\s*\)\@<=\%(\<\%(private\|public\)\>\s\+\)\=\<function\>\s\+\([^ \t(]\+\):\%(^\s*\)\@<=\<\1\>\s*=:\%(^\s*\)\@<=\<end\>\s\+\<function\>,' . + \ '\%(^\s*\)\@<=\%(\<\%(private\|public\)\>\s\+\)\=\<sub\>\s\+:\%(^\s*\)\@<=\<end\>\s\+\<sub\>' + let b:undo_ftplugin .= " | unlet! b:match_words b:match_ignorecase" +endif -" NOTE the double escaping \\| -nnoremap <buffer> <silent> [[ :call <SID>VbSearch('^\s*\(\(private\|public\)\s\+\)\=\(function\\|sub\)', 'bW')<cr> -nnoremap <buffer> <silent> ]] :call <SID>VbSearch('^\s*\(\(private\|public\)\s\+\)\=\(function\\|sub\)', 'W')<cr> -nnoremap <buffer> <silent> [] :call <SID>VbSearch('^\s*\<end\>\s\+\(function\\|sub\)', 'bW')<cr> -nnoremap <buffer> <silent> ][ :call <SID>VbSearch('^\s*\<end\>\s\+\(function\\|sub\)', 'W')<cr> - -" matchit support -if exists("loaded_matchit") - let b:match_ignorecase=1 - let b:match_words= - \ '\%(^\s*\)\@<=\<if\>.*\<then\>\s*$:\%(^\s*\)\@<=\<else\>:\%(^\s*\)\@<=\<elseif\>:\%(^\s*\)\@<=\<end\>\s\+\<if\>,' . - \ '\%(^\s*\)\@<=\<for\>:\%(^\s*\)\@<=\<next\>,' . - \ '\%(^\s*\)\@<=\<while\>:\%(^\s*\)\@<=\<wend\>,' . - \ '\%(^\s*\)\@<=\<do\>:\%(^\s*\)\@<=\<loop\>\s\+\<while\>,' . - \ '\%(^\s*\)\@<=\<select\>\s\+\<case\>:\%(^\s*\)\@<=\<case\>:\%(^\s*\)\@<=\<end\>\s\+\<select\>,' . - \ '\%(^\s*\)\@<=\<enum\>:\%(^\s*\)\@<=\<end\>\s\<enum\>,' . - \ '\%(^\s*\)\@<=\<with\>:\%(^\s*\)\@<=\<end\>\s\<with\>,' . - \ '\%(^\s*\)\@<=\%(\<\%(private\|public\)\>\s\+\)\=\<function\>\s\+\([^ \t(]\+\):\%(^\s*\)\@<=\<\1\>\s*=:\%(^\s*\)\@<=\<end\>\s\+\<function\>,' . - \ '\%(^\s*\)\@<=\%(\<\%(private\|public\)\>\s\+\)\=\<sub\>\s\+:\%(^\s*\)\@<=\<end\>\s\+\<sub\>' +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Visual Basic Source Files (*.bas)\t*.bas\n" . + \ "Visual Basic Form Files (*.frm)\t*.frm\n" . + \ "All Files (*.*)\t*.*\n" + let b:undo_ftplugin .= " | unlet! b:browsefilter" endif let &cpo = s:cpo_save diff --git a/ftplugin/zig.vim b/ftplugin/zig.vim index cb2f3e84..1e6f91b3 100644 --- a/ftplugin/zig.vim +++ b/ftplugin/zig.vim @@ -39,14 +39,18 @@ endif let &l:define='\v(<fn>|<const>|<var>|^\s*\#\s*define)' -if exists("*json_decode") && executable('zig') +if !exists('g:zig_std_dir') && exists('*json_decode') && executable('zig') silent let s:env = system('zig env') if v:shell_error == 0 - let &l:path=json_decode(s:env)['std_dir'] . ',' . &l:path + let g:zig_std_dir = json_decode(s:env)['std_dir'] endif unlet! s:env endif +if exists('g:zig_std_dir') + let &l:path = g:zig_std_dir . ',' . &l:path +endif + let b:undo_ftplugin = \ 'setl isk< et< ts< sts< sw< fo< sua< mp< com< cms< inex< inc< pa<' 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 <Bram@vim.org> -" 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*\)\@<=\(}\|\<UNTIL\>\)' - -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*\)\@<=\(}\|\<UNTIL\>\)' + 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 <buffer> <expr> until GCUpperSpace("until") iabbr <buffer> <expr> while GCUpperSpace("while") iabbr <buffer> <expr> repeat GCUpper("repeat") +let b:undo_ftplugin ..= + \ " | iunabbr <buffer> alias" .. + \ " | iunabbr <buffer> arg" .. + \ " | iunabbr <buffer> break" .. + \ " | iunabbr <buffer> case" .. + \ " | iunabbr <buffer> catch" .. + \ " | iunabbr <buffer> check" .. + \ " | iunabbr <buffer> class" .. + \ " | iunabbr <buffer> interface" .. + \ " | iunabbr <buffer> implements" .. + \ " | iunabbr <buffer> shared" .. + \ " | iunabbr <buffer> continue" .. + \ " | iunabbr <buffer> default" .. + \ " | iunabbr <buffer> extends" .. + \ " | iunabbr <buffer> do" .. + \ " | iunabbr <buffer> else" .. + \ " | iunabbr <buffer> elseif" .. + \ " | iunabbr <buffer> enum" .. + \ " | iunabbr <buffer> exit" .. + \ " | iunabbr <buffer> false" .. + \ " | iunabbr <buffer> fail" .. + \ " | iunabbr <buffer> finally" .. + \ " | iunabbr <buffer> for" .. + \ " | iunabbr <buffer> func" .. + \ " | iunabbr <buffer> if" .. + \ " | iunabbr <buffer> import" .. + \ " | iunabbr <buffer> in" .. + \ " | iunabbr <buffer> io" .. + \ " | iunabbr <buffer> main" .. + \ " | iunabbr <buffer> module" .. + \ " | iunabbr <buffer> new" .. + \ " | iunabbr <buffer> nil" .. + \ " | iunabbr <buffer> ok" .. + \ " | iunabbr <buffer> proc" .. + \ " | iunabbr <buffer> proceed" .. + \ " | iunabbr <buffer> return" .. + \ " | iunabbr <buffer> step" .. + \ " | iunabbr <buffer> switch" .. + \ " | iunabbr <buffer> sys" .. + \ " | iunabbr <buffer> this" .. + \ " | iunabbr <buffer> throw" .. + \ " | iunabbr <buffer> try" .. + \ " | iunabbr <buffer> to" .. + \ " | iunabbr <buffer> true" .. + \ " | iunabbr <buffer> until" .. + \ " | iunabbr <buffer> while" .. + \ " | iunabbr <buffer> repeat" + if !exists("no_plugin_maps") && !exists("no_zimbu_maps") nnoremap <silent> <buffer> [[ m`:call ZimbuGoStartBlock()<CR> nnoremap <silent> <buffer> ]] m`:call ZimbuGoEndBlock()<CR> + let b:undo_ftplugin ..= + \ " | silent! exe 'nunmap <buffer> [['" .. + \ " | silent! exe 'nunmap <buffer> ]]'" endif " Using a function makes sure the search pattern is restored |