blob: 6594f2ea90f48b0c228a8cf8ef3e9d1ef0604c67 [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 Moolenaar5c736222010-01-06 20:54:52 +01004" Last Change: Wed Sep 3 15:24:49 CST 2008
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 Moolenaar5c736222010-01-06 20:54:52 +010015" Set 'cpoptions' to allow line continuations
16let s:cpo_save = &cpo
17set cpo&vim
18
Bram Moolenaar92d640f2005-09-05 22:11:52 +000019" Undo the plugin effect
20let b:undo_ftplugin = "setlocal fo< com< tw<"
Bram Moolenaard68071d2006-05-02 22:08:30 +000021 \ . "| unlet! b:browsefilter b:match_ignorecase b:match_words"
Bram Moolenaar92d640f2005-09-05 22:11:52 +000022
Bram Moolenaar071d4272004-06-13 20:20:40 +000023" Set 'formatoptions' to break comment lines but not other lines,
24" and insert the comment leader when hitting <CR> or using "o".
25setlocal fo-=t fo+=croqlm1
26
27" Set 'comments' to format dashed lists in comments.
28setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
29
30" Format comments to be up to 78 characters long
Bram Moolenaar92d640f2005-09-05 22:11:52 +000031if &textwidth == 0
32 setlocal tw=78
33endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000034
Bram Moolenaar071d4272004-06-13 20:20:40 +000035" Win32 can filter files in the browse dialog
36if has("gui_win32") && !exists("b:browsefilter")
37 let b:browsefilter = "Verilog Source Files (*.v)\t*.v\n" .
38 \ "All Files (*.*)\t*.*\n"
39endif
40
41" Let the matchit plugin know what items can be matched.
42if 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\>'
53endif
Bram Moolenaar5c736222010-01-06 20:54:52 +010054
55" Reset 'cpoptions' back to the user's setting
56let &cpo = s:cpo_save
57unlet s:cpo_save