1 " Vim filetype plugin file
2 " Language: Verilog HDL
3 " Maintainer: Chih-Tsun Huang <cthuang@larc.ee.nthu.edu.tw>
4 " Last Change: Wed Sep 3 15:24:49 CST 2008
5 " URL: http://larc.ee.nthu.edu.tw/~cthuang/vim/ftplugin/verilog.vim
7 " Only do this when not done yet for this buffer
8 if exists("b:did_ftplugin")
12 " Don't load another plugin for this buffer
13 let b:did_ftplugin = 1
15 " Set 'cpoptions' to allow line continuations
19 " Undo the plugin effect
20 let b:undo_ftplugin = "setlocal fo< com< tw<"
21 \ . "| unlet! b:browsefilter b:match_ignorecase b:match_words"
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
27 " Set 'comments' to format dashed lists in comments.
28 setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
30 " Format comments to be up to 78 characters long
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"
41 " Let the matchit plugin know what items can be matched.
42 if exists("loaded_matchit")
43 let b:match_ignorecase=0
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\>'
55 " Reset 'cpoptions' back to the user's setting