1" Vim filetype plugin file 2" Language: Verilog HDL 3" Maintainer: Chih-Tsun Huang <[email protected]> 4" Last Change: Mon Sep 5 11:05:54 CST 2005 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" Undo the plugin effect 16let b:undo_ftplugin = "setlocal fo< com< tw<" 17 \ . "| unlet b:browsefilter b:match_ignorecase b:match_words" 18 19" 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 27if &textwidth == 0 28 setlocal tw=78 29endif 30 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 52