Merge branch 'MacVim'
[MacVim/KaoriYa.git] / runtime / ftplugin / verilog.vim
blob6594f2ea90f48b0c228a8cf8ef3e9d1ef0604c67
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")
9   finish
10 endif
12 " Don't load another plugin for this buffer
13 let b:did_ftplugin = 1
15 " Set 'cpoptions' to allow line continuations
16 let s:cpo_save = &cpo
17 set cpo&vim
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
31 if &textwidth == 0 
32   setlocal tw=78
33 endif
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
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
55 " Reset 'cpoptions' back to the user's setting
56 let &cpo = s:cpo_save
57 unlet s:cpo_save