diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 02:44:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 02:44:24 +0000 |
commit | 8baab3c8d7a6f22888bd581cd5c6098fd2e4b5a8 (patch) | |
tree | 3537e168b860f2742f6029d70501b5ed7d15d345 /runtime/ftplugin/vb.vim | |
parent | Initial commit. (diff) | |
download | vim-8baab3c8d7a6f22888bd581cd5c6098fd2e4b5a8.tar.xz vim-8baab3c8d7a6f22888bd581cd5c6098fd2e4b5a8.zip |
Adding upstream version 2:8.1.0875.upstream/2%8.1.0875upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'runtime/ftplugin/vb.vim')
-rw-r--r-- | runtime/ftplugin/vb.vim | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/runtime/ftplugin/vb.vim b/runtime/ftplugin/vb.vim new file mode 100644 index 0000000..d70db89 --- /dev/null +++ b/runtime/ftplugin/vb.vim @@ -0,0 +1,45 @@ +" 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 + +if exists("b:did_ftplugin") | finish | endif +let b:did_ftplugin = 1 + +setlocal com=sr:'\ -,mb:'\ \ ,el:'\ \ ,:' + +" we need this wrapper, as call doesn't allow a count +fun! <SID>VbSearch(pattern, flags) + let cnt = v:count1 + while cnt > 0 + call search(a:pattern, a:flags) + let cnt = cnt - 1 + endwhile +endfun + +let s:cpo_save = &cpo +set cpo&vim + +" 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\>' +endif + +let &cpo = s:cpo_save +unlet s:cpo_save |