annotate runtime/ftplugin/vhdl.vim @ 1624:18ee39301b82 v7.2a

updated for version 7.2a
author vimboss
date Tue, 24 Jun 2008 22:58:06 +0000
parents 83a006f81bac
children 8b8ef1fed009
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
671
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
1 " VHDL filetype plugin
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
2 " Language: VHDL
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
3 " Maintainer: R.Shankar <shankar.r?freescale.com>
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
4 " Modified By: Gerald Lai <laigera+vim?gmail.com>
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
5 " Last Change: 2006 Feb 16
153
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
6
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
7 " Only do this when not done yet for this buffer
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
8 if exists("b:did_ftplugin")
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
9 finish
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
10 endif
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
11
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
12 " Don't load another plugin for this buffer
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
13 let b:did_ftplugin = 1
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
14
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
15 " Set 'formatoptions' to break comment lines but not other lines,
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
16 " and insert the comment leader when hitting <CR> or using "o".
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
17 "setlocal fo-=t fo+=croqlm1
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
18
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
19 " Set 'comments' to format dashed lists in comments.
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
20 "setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
21
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
22 " Format comments to be up to 78 characters long
671
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
23 "setlocal tw=75
153
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
24
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
25 set cpo-=C
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
26
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
27 " Win32 can filter files in the browse dialog
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
28 "if has("gui_win32") && !exists("b:browsefilter")
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
29 " let b:browsefilter = "Verilog Source Files (*.v)\t*.v\n" .
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
30 " \ "All Files (*.*)\t*.*\n"
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
31 "endif
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
32
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
33 " Let the matchit plugin know what items can be matched.
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
34 if ! exists("b:match_words") && exists("loaded_matchit")
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
35 let b:match_ignorecase=1
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
36 let s:notend = '\%(\<end\s\+\)\@<!'
671
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
37 let b:match_words =
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
38 \ s:notend.'\<if\>:\<elsif\>:\<else\>:\<end\s\+if\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
39 \ s:notend.'\<case\>:\<when\>:\<end\s\+case\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
40 \ s:notend.'\<loop\>:\<end\s\+loop\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
41 \ s:notend.'\<for\>:\<end\s\+for\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
42 \ s:notend.'\<generate\>:\<end\s\+generate\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
43 \ s:notend.'\<record\>:\<end\s\+record\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
44 \ s:notend.'\<units\>:\<end\s\+units\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
45 \ s:notend.'\<process\>:\<end\s\+process\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
46 \ s:notend.'\<block\>:\<end\s\+block\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
47 \ s:notend.'\<function\>:\<end\s\+function\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
48 \ s:notend.'\<entity\>:\<end\s\+entity\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
49 \ s:notend.'\<component\>:\<end\s\+component\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
50 \ s:notend.'\<architecture\>:\<end\s\+architecture\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
51 \ s:notend.'\<package\>:\<end\s\+package\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
52 \ s:notend.'\<procedure\>:\<end\s\+procedure\>,'.
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
53 \ s:notend.'\<configuration\>:\<end\s\+configuration\>'
153
19670b05ee32 updated for version 7.0047
vimboss
parents:
diff changeset
54 endif
671
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
55
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
56 " count repeat
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
57 function! <SID>CountWrapper(cmd)
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
58 let i = v:count1
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
59 if a:cmd[0] == ":"
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
60 while i > 0
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
61 execute a:cmd
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
62 let i = i - 1
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
63 endwhile
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
64 else
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
65 execute "normal! gv\<Esc>"
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
66 execute "normal ".i.a:cmd
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
67 let curcol = col(".")
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
68 let curline = line(".")
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
69 normal! gv
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
70 call cursor(curline, curcol)
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
71 endif
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
72 endfunction
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
73
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
74 " explore motion
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
75 " keywords: "architecture", "block", "configuration", "component", "entity", "function", "package", "procedure", "process", "record", "units"
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
76 let b:vhdl_explore = '\%(architecture\|block\|configuration\|component\|entity\|function\|package\|procedure\|process\|record\|units\)'
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
77 noremap <buffer><silent>[[ :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\%(\\<end\\s\\+\\)\\@<!\\<".b:vhdl_explore."\\>\\c\\<Bar>\\%^","bW")')<CR>
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
78 noremap <buffer><silent>]] :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\%(\\<end\\s\\+\\)\\@<!\\<".b:vhdl_explore."\\>\\c\\<Bar>\\%$","W")')<CR>
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
79 noremap <buffer><silent>[] :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\<end\\s\\+".b:vhdl_explore."\\>\\c\\<Bar>\\%^","bW")')<CR>
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
80 noremap <buffer><silent>][ :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\<end\\s\\+".b:vhdl_explore."\\>\\c\\<Bar>\\%$","W")')<CR>
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
81 vnoremap <buffer><silent>[[ :<C-u>cal <SID>CountWrapper('[[')<CR>
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
82 vnoremap <buffer><silent>]] :<C-u>cal <SID>CountWrapper(']]')<CR>
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
83 vnoremap <buffer><silent>[] :<C-u>cal <SID>CountWrapper('[]')<CR>
83a006f81bac updated for version 7.0199
vimboss
parents: 153
diff changeset
84 vnoremap <buffer><silent>][ :<C-u>cal <SID>CountWrapper('][')<CR>