Merge branch 'vim' into feat/code-check
[vim_extended.git] / runtime / ftplugin / verilog.vim
blob1d37d601acf5df9214f3cec8ba3bf8675f3cdd09
1 " Vim filetype plugin file
2 " Language:     Verilog HDL
3 " Maintainer:   Chih-Tsun Huang <cthuang@larc.ee.nthu.edu.tw>
4 " Last Change:  Mon Sep  5 11:05:54 CST 2005 and 2006 April 30
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")
9   finish
10 endif
12 " Don't load another plugin for this buffer
13 let b:did_ftplugin = 1
15 " Undo the plugin effect
16 let b:undo_ftplugin = "setlocal fo< com< tw<"
17     \ . "| unlet! b:browsefilter b:match_ignorecase b:match_words"
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
23 " Set 'comments' to format dashed lists in comments.
24 setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
26 " Format comments to be up to 78 characters long
27 if &textwidth == 0 
28   setlocal tw=78
29 endif
31 set cpo-=C
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
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