7
|
1 " Vim filetype plugin file
|
|
2 " Language: VisualBasic (ft=vb)
|
|
3 " Maintainer: Johannes Zellner <johannes@zellner.org>
|
|
4 " Last Change: Thu, 22 Nov 2001 12:56:14 W. Europe Standard Time
|
|
5
|
|
6 if exists("b:did_ftplugin") | finish | endif
|
|
7 let b:did_ftplugin = 1
|
|
8
|
|
9 setlocal com=sr:'\ -,mb:'\ \ ,el:'\ \ ,:'
|
|
10
|
|
11 " we need this wrapper, as call doesn't allow a count
|
|
12 fun! <SID>VbSearch(pattern, flags)
|
|
13 let cnt = v:count1
|
|
14 while cnt > 0
|
|
15 call search(a:pattern, a:flags)
|
|
16 let cnt = cnt - 1
|
|
17 endwhile
|
|
18 endfun
|
|
19
|
|
20 let s:cpo_save = &cpo
|
|
21 set cpo&vim
|
|
22
|
|
23 " NOTE the double escaping \\|
|
|
24 nnoremap <buffer> <silent> [[ :call <SID>VbSearch('^\s*\(\(private\|public\)\s\+\)\=\(function\\|sub\)', 'bW')<cr>
|
|
25 nnoremap <buffer> <silent> ]] :call <SID>VbSearch('^\s*\(\(private\|public\)\s\+\)\=\(function\\|sub\)', 'W')<cr>
|
|
26 nnoremap <buffer> <silent> [] :call <SID>VbSearch('^\s*\<end\>\s\+\(function\\|sub\)', 'bW')<cr>
|
|
27 nnoremap <buffer> <silent> ][ :call <SID>VbSearch('^\s*\<end\>\s\+\(function\\|sub\)', 'W')<cr>
|
|
28
|
|
29 " matchit support
|
|
30 if exists("loaded_matchit")
|
|
31 let b:match_ignorecase=1
|
|
32 let b:match_words=
|
|
33 \ '\%(^\s*\)\@<=\<if\>.*\<then\>\s*$:\%(^\s*\)\@<=\<else\>:\%(^\s*\)\@<=\<elseif\>:\%(^\s*\)\@<=\<end\>\s\+\<if\>,' .
|
|
34 \ '\%(^\s*\)\@<=\<for\>:\%(^\s*\)\@<=\<next\>,' .
|
|
35 \ '\%(^\s*\)\@<=\<while\>:\%(^\s*\)\@<=\<wend\>,' .
|
|
36 \ '\%(^\s*\)\@<=\<do\>:\%(^\s*\)\@<=\<loop\>\s\+\<while\>,' .
|
|
37 \ '\%(^\s*\)\@<=\<select\>\s\+\<case\>:\%(^\s*\)\@<=\<case\>:\%(^\s*\)\@<=\<end\>\s\+\<select\>,' .
|
|
38 \ '\%(^\s*\)\@<=\<enum\>:\%(^\s*\)\@<=\<end\>\s\<enum\>,' .
|
|
39 \ '\%(^\s*\)\@<=\<with\>:\%(^\s*\)\@<=\<end\>\s\<with\>,' .
|
|
40 \ '\%(^\s*\)\@<=\%(\<\%(private\|public\)\>\s\+\)\=\<function\>\s\+\([^ \t(]\+\):\%(^\s*\)\@<=\<\1\>\s*=:\%(^\s*\)\@<=\<end\>\s\+\<function\>,' .
|
|
41 \ '\%(^\s*\)\@<=\%(\<\%(private\|public\)\>\s\+\)\=\<sub\>\s\+:\%(^\s*\)\@<=\<end\>\s\+\<sub\>'
|
|
42 endif
|
|
43
|
|
44 let &cpo = s:cpo_save
|
|
45 unlet s:cpo_save
|