Mercurial > vim
comparison runtime/indent/vhdl.vim @ 667:9090f866cd57 v7.0197
updated for version 7.0197
author | vimboss |
---|---|
date | Tue, 14 Feb 2006 22:29:30 +0000 |
parents | 8157079cea85 |
children | 01583c79d5f4 |
comparison
equal
deleted
inserted
replaced
666:0137e7c3d31b | 667:9090f866cd57 |
---|---|
1 " VHDL indent ('93 syntax) | 1 " VHDL indent ('93 syntax) |
2 " Language: VHDL | 2 " Language: VHDL |
3 " Maintainer: Gerald Lai <laigera+vim?gmail.com> | 3 " Maintainer: Gerald Lai <laigera+vim?gmail.com> |
4 " Version: 1.3 | 4 " Version: 1.34 |
5 " Last Change: 2006 Jan 31 | 5 " Last Change: 2006 Feb 11 |
6 " URL: http://www.vim.org/scripts/script.php?script_id=1450 | 6 " URL: http://www.vim.org/scripts/script.php?script_id=1450 |
7 | 7 |
8 " only load this indent file when no other was loaded | 8 " only load this indent file when no other was loaded |
9 if exists("b:did_indent") | 9 if exists("b:did_indent") |
10 finish | 10 finish |
15 setlocal indentexpr=GetVHDLindent() | 15 setlocal indentexpr=GetVHDLindent() |
16 setlocal indentkeys=!^F,o,O,e,0(,0) | 16 setlocal indentkeys=!^F,o,O,e,0(,0) |
17 setlocal indentkeys+==~if,=~then,=~elsif,=~else | 17 setlocal indentkeys+==~if,=~then,=~elsif,=~else |
18 setlocal indentkeys+==~begin,=~is,=~select,=~-- | 18 setlocal indentkeys+==~begin,=~is,=~select,=~-- |
19 | 19 |
20 " move around | 20 " count repeat |
21 function! <SID>CountWrapper(cmd) | |
22 let i = v:count1 | |
23 if a:cmd[0] == ":" | |
24 while i > 0 | |
25 execute a:cmd | |
26 let i = i - 1 | |
27 endwhile | |
28 else | |
29 execute "normal! gv\<Esc>" | |
30 execute "normal ".i.a:cmd | |
31 let curcol = col(".") | |
32 let curline = line(".") | |
33 normal! gv | |
34 call cursor(curline, curcol) | |
35 endif | |
36 endfunction | |
37 | |
38 " explore motion | |
21 " keywords: "architecture", "block", "configuration", "component", "entity", "function", "package", "procedure", "process", "record", "units" | 39 " keywords: "architecture", "block", "configuration", "component", "entity", "function", "package", "procedure", "process", "record", "units" |
22 let b:vhdl_explore = '\%(architecture\|block\|configuration\|component\|entity\|function\|package\|procedure\|process\|record\|units\)' | 40 let b:vhdl_explore = '\%(architecture\|block\|configuration\|component\|entity\|function\|package\|procedure\|process\|record\|units\)' |
23 nnoremap <silent><buffer>[[ :cal search('\%(\<end\s\+\)\@<!\<'.b:vhdl_explore.'\>\c','bW')<CR> | 41 noremap <buffer><silent>[[ :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\%(\\<end\\s\\+\\)\\@<!\\<".b:vhdl_explore."\\>\\c\\<Bar>\\%^","bW")')<CR> |
24 nnoremap <silent><buffer>]] :cal search('\%(\<end\s\+\)\@<!\<'.b:vhdl_explore.'\>\c','W')<CR> | 42 noremap <buffer><silent>]] :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\%(\\<end\\s\\+\\)\\@<!\\<".b:vhdl_explore."\\>\\c\\<Bar>\\%$","W")')<CR> |
25 nnoremap <silent><buffer>[] :cal search('\<end\s\+'.b:vhdl_explore.'\>\c','bW')<CR> | 43 noremap <buffer><silent>[] :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\<end\\s\\+".b:vhdl_explore."\\>\\c\\<Bar>\\%^","bW")')<CR> |
26 nnoremap <silent><buffer>][ :cal search('\<end\s\+'.b:vhdl_explore.'\>\c','W')<CR> | 44 noremap <buffer><silent>][ :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\<end\\s\\+".b:vhdl_explore."\\>\\c\\<Bar>\\%$","W")')<CR> |
45 vnoremap <buffer><silent>[[ :<C-u>cal <SID>CountWrapper('[[')<CR> | |
46 vnoremap <buffer><silent>]] :<C-u>cal <SID>CountWrapper(']]')<CR> | |
47 vnoremap <buffer><silent>[] :<C-u>cal <SID>CountWrapper('[]')<CR> | |
48 vnoremap <buffer><silent>][ :<C-u>cal <SID>CountWrapper('][')<CR> | |
27 | 49 |
28 " constants | 50 " constants |
29 " not a comment | 51 " not a comment |
30 let s:NC = '\%(--.*\)\@<!' | 52 let s:NC = '\%(--.*\)\@<!' |
31 " end of string | 53 " end of string |