1" Vim filetype plugin file 2" Language: Verilog HDL 3" Maintainer: Chih-Tsun Huang <[email protected]> 4" Last Change: Wed Sep 3 15:24:49 CST 2008 5" 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 15" Set 'cpoptions' to allow line continuations 16let s:cpo_save = &cpo 17set cpo&vim 18 19" Undo the plugin effect 20let b:undo_ftplugin = "setlocal fo< com< tw<" 21 \ . "| unlet! b:browsefilter b:match_ignorecase b:match_words" 22 23" 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 31if &textwidth == 0 32 setlocal tw=78 33endif 34 35" 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 54 55" Reset 'cpoptions' back to the user's setting 56let &cpo = s:cpo_save 57unlet s:cpo_save 58