7
|
1 " Vim filetype plugin file
|
|
2 " Language: Verilog HDL
|
|
3 " Maintainer: Chih-Tsun Huang <cthuang@larc.ee.nthu.edu.tw>
|
2034
|
4 " Last Change: Wed Sep 3 15:24:49 CST 2008
|
7
|
5 " URL: http://larc.ee.nthu.edu.tw/~cthuang/vim/ftplugin/verilog.vim
|
|
6
|
|
7 " Only do this when not done yet for this buffer
|
|
8 if exists("b:did_ftplugin")
|
|
9 finish
|
|
10 endif
|
|
11
|
|
12 " Don't load another plugin for this buffer
|
|
13 let b:did_ftplugin = 1
|
|
14
|
2034
|
15 " Set 'cpoptions' to allow line continuations
|
|
16 let s:cpo_save = &cpo
|
|
17 set cpo&vim
|
|
18
|
504
|
19 " Undo the plugin effect
|
|
20 let b:undo_ftplugin = "setlocal fo< com< tw<"
|
857
|
21 \ . "| unlet! b:browsefilter b:match_ignorecase b:match_words"
|
504
|
22
|
7
|
23 " Set 'formatoptions' to break comment lines but not other lines,
|
|
24 " and insert the comment leader when hitting <CR> or using "o".
|
|
25 setlocal fo-=t fo+=croqlm1
|
|
26
|
|
27 " Set 'comments' to format dashed lists in comments.
|
|
28 setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
|
|
29
|
|
30 " Format comments to be up to 78 characters long
|
504
|
31 if &textwidth == 0
|
|
32 setlocal tw=78
|
|
33 endif
|
7
|
34
|
|
35 " Win32 can filter files in the browse dialog
|
|
36 if has("gui_win32") && !exists("b:browsefilter")
|
|
37 let b:browsefilter = "Verilog Source Files (*.v)\t*.v\n" .
|
|
38 \ "All Files (*.*)\t*.*\n"
|
|
39 endif
|
|
40
|
|
41 " Let the matchit plugin know what items can be matched.
|
|
42 if exists("loaded_matchit")
|
|
43 let b:match_ignorecase=0
|
|
44 let b:match_words=
|
|
45 \ '\<begin\>:\<end\>,' .
|
|
46 \ '\<case\>\|\<casex\>\|\<casez\>:\<endcase\>,' .
|
|
47 \ '\<module\>:\<endmodule\>,' .
|
|
48 \ '\<if\>:\<else\>,' .
|
|
49 \ '\<function\>:\<endfunction\>,' .
|
|
50 \ '`ifdef\>:`else\>:`endif\>,' .
|
|
51 \ '\<task\>:\<endtask\>,' .
|
|
52 \ '\<specify\>:\<endspecify\>'
|
|
53 endif
|
2034
|
54
|
|
55 " Reset 'cpoptions' back to the user's setting
|
|
56 let &cpo = s:cpo_save
|
|
57 unlet s:cpo_save
|