7
|
1 " Vim filetype plugin file
|
|
2 " Language: Verilog HDL
|
|
3 " Maintainer: Chih-Tsun Huang <cthuang@larc.ee.nthu.edu.tw>
|
857
|
4 " Last Change: Mon Sep 5 11:05:54 CST 2005 and 2006 April 30
|
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
|
504
|
15 " Undo the plugin effect
|
|
16 let b:undo_ftplugin = "setlocal fo< com< tw<"
|
857
|
17 \ . "| unlet! b:browsefilter b:match_ignorecase b:match_words"
|
504
|
18
|
7
|
19 " Set 'formatoptions' to break comment lines but not other lines,
|
|
20 " and insert the comment leader when hitting <CR> or using "o".
|
|
21 setlocal fo-=t fo+=croqlm1
|
|
22
|
|
23 " Set 'comments' to format dashed lists in comments.
|
|
24 setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
|
|
25
|
|
26 " Format comments to be up to 78 characters long
|
504
|
27 if &textwidth == 0
|
|
28 setlocal tw=78
|
|
29 endif
|
7
|
30
|
|
31 set cpo-=C
|
|
32
|
|
33 " Win32 can filter files in the browse dialog
|
|
34 if has("gui_win32") && !exists("b:browsefilter")
|
|
35 let b:browsefilter = "Verilog Source Files (*.v)\t*.v\n" .
|
|
36 \ "All Files (*.*)\t*.*\n"
|
|
37 endif
|
|
38
|
|
39 " Let the matchit plugin know what items can be matched.
|
|
40 if exists("loaded_matchit")
|
|
41 let b:match_ignorecase=0
|
|
42 let b:match_words=
|
|
43 \ '\<begin\>:\<end\>,' .
|
|
44 \ '\<case\>\|\<casex\>\|\<casez\>:\<endcase\>,' .
|
|
45 \ '\<module\>:\<endmodule\>,' .
|
|
46 \ '\<if\>:\<else\>,' .
|
|
47 \ '\<function\>:\<endfunction\>,' .
|
|
48 \ '`ifdef\>:`else\>:`endif\>,' .
|
|
49 \ '\<task\>:\<endtask\>,' .
|
|
50 \ '\<specify\>:\<endspecify\>'
|
|
51 endif
|