7
|
1 " Vim filetype plugin file
|
|
2 " Language: Verilog HDL
|
12254
|
3 " Maintainer: Chih-Tsun Huang <cthuang@cs.nthu.edu.tw>
|
|
4 " Last Change: 2017 Aug 25 by Chih-Tsun Huang
|
|
5 " URL: http://www.cs.nthu.edu.tw/~cthuang/vim/ftplugin/verilog.vim
|
|
6 "
|
|
7 " Credits:
|
|
8 " Suggestions for improvement, bug reports by
|
|
9 " Shao <shaominghai2005@163.com>
|
7
|
10
|
|
11 " Only do this when not done yet for this buffer
|
|
12 if exists("b:did_ftplugin")
|
|
13 finish
|
|
14 endif
|
|
15
|
|
16 " Don't load another plugin for this buffer
|
|
17 let b:did_ftplugin = 1
|
|
18
|
2034
|
19 " Set 'cpoptions' to allow line continuations
|
|
20 let s:cpo_save = &cpo
|
|
21 set cpo&vim
|
|
22
|
504
|
23 " Undo the plugin effect
|
|
24 let b:undo_ftplugin = "setlocal fo< com< tw<"
|
857
|
25 \ . "| unlet! b:browsefilter b:match_ignorecase b:match_words"
|
504
|
26
|
7
|
27 " Set 'formatoptions' to break comment lines but not other lines,
|
|
28 " and insert the comment leader when hitting <CR> or using "o".
|
|
29 setlocal fo-=t fo+=croqlm1
|
|
30
|
|
31 " Set 'comments' to format dashed lists in comments.
|
|
32 setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
|
|
33
|
|
34 " Format comments to be up to 78 characters long
|
504
|
35 if &textwidth == 0
|
|
36 setlocal tw=78
|
|
37 endif
|
7
|
38
|
|
39 " Win32 can filter files in the browse dialog
|
|
40 if has("gui_win32") && !exists("b:browsefilter")
|
|
41 let b:browsefilter = "Verilog Source Files (*.v)\t*.v\n" .
|
|
42 \ "All Files (*.*)\t*.*\n"
|
|
43 endif
|
|
44
|
|
45 " Let the matchit plugin know what items can be matched.
|
|
46 if exists("loaded_matchit")
|
|
47 let b:match_ignorecase=0
|
|
48 let b:match_words=
|
|
49 \ '\<begin\>:\<end\>,' .
|
|
50 \ '\<case\>\|\<casex\>\|\<casez\>:\<endcase\>,' .
|
|
51 \ '\<module\>:\<endmodule\>,' .
|
12254
|
52 \ '\<if\>:`\@<!\<else\>,' .
|
7
|
53 \ '\<function\>:\<endfunction\>,' .
|
12254
|
54 \ '`ifn\?def\>:`elsif\>:`else\>:`endif\>,' .
|
7
|
55 \ '\<task\>:\<endtask\>,' .
|
12254
|
56 \ '\<specify\>:\<endspecify\>,' .
|
|
57 \ '\<config\>:\<endconfig\>,' .
|
|
58 \ '\<generate\>:\<endgenerate\>,' .
|
|
59 \ '\<fork\>:\<join\>,' .
|
|
60 \ '\<primitive\>:\<endprimitive\>,' .
|
|
61 \ '\<table\>:\<endtable\>'
|
7
|
62 endif
|
2034
|
63
|
|
64 " Reset 'cpoptions' back to the user's setting
|
|
65 let &cpo = s:cpo_save
|
|
66 unlet s:cpo_save
|