2010年11月23日星期二

vim matchit for systemverilog

1, in ~/.vimrc
source $VIMRUNTIME/macros/matchit.vim
filetype plugin indent on

2, edit file ~/.vim/ftplugin/verilog_systemverilog_matchit.vim:

if exists("loaded_verilog_systemverilog_matchit")
   finish
endif
let loaded_verilog_systemverilog_matchit = 1

let b:match_words = '\<begin\>:\<end\>,'
let b:match_words .= '\<module\>:\<endmodule\>,'
let b:match_words .= '\<interface\>:\<endinterface\>,'
let b:match_words .= '\<class\>:\<endclass\>,'
let b:match_words .= '\<task\>:\<endtask\>,'
let b:match_words .= '\<function\>:\<endfunction\>,'
let b:match_words .= '\<package\>:\<endpackage\>,'
let b:match_words .= '\<ifndef\>:\<endif\>,'
let b:match_words .= '\<ifdef\>:\<endif\>,'