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