blob: 2f426acde30ea973a3cabae103f4463d0ccfd4de [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim filetype plugin file
2" Language: Verilog HDL
3" Maintainer: Chih-Tsun Huang <cthuang@larc.ee.nthu.edu.tw>
Bram Moolenaar92d640f2005-09-05 22:11:52 +00004" Last Change: Mon Sep 5 11:05:54 CST 2005
Bram Moolenaar071d4272004-06-13 20:20:40 +00005" URL: http://larc.ee.nthu.edu.tw/~cthuang/vim/ftplugin/verilog.vim
6
7" Only do this when not done yet for this buffer
8if exists("b:did_ftplugin")
9 finish
10endif
11
12" Don't load another plugin for this buffer
13let b:did_ftplugin = 1
14
Bram Moolenaar92d640f2005-09-05 22:11:52 +000015" Undo the plugin effect
16let b:undo_ftplugin = "setlocal fo< com< tw<"
17 \ . "| unlet b:browsefilter b:match_ignorecase b:match_words"
18
Bram Moolenaar071d4272004-06-13 20:20:40 +000019" Set 'formatoptions' to break comment lines but not other lines,
20" and insert the comment leader when hitting <CR> or using "o".
21setlocal fo-=t fo+=croqlm1
22
23" Set 'comments' to format dashed lists in comments.
24setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
25
26" Format comments to be up to 78 characters long
Bram Moolenaar92d640f2005-09-05 22:11:52 +000027if &textwidth == 0
28 setlocal tw=78
29endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000030
31set cpo-=C
32
33" Win32 can filter files in the browse dialog
34if has("gui_win32") && !exists("b:browsefilter")
35 let b:browsefilter = "Verilog Source Files (*.v)\t*.v\n" .
36 \ "All Files (*.*)\t*.*\n"
37endif
38
39" Let the matchit plugin know what items can be matched.
40if 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\>'
51endif