ASIC/FPGA Design and Verification Out Source Services
VIM enabling systemverilog syntax
Automatic detect a system verilog file and start its syntax coloring in VIM.
- Although there are many explanations in the web, it took me time to find one, that works on my system.
Once it did work for me, I decided to document
what I did.
- First I created a directory in my home user. ~/.vim. It contains a file named: filetype.vim:
if did_filetype() " filetype already set..
finish " ..don't do these checks
endif
if getline(1) =~ '^#!.*\'
setfiletype mine
elseif getline(1) =~? '\'
setfiletype drawing
endif
- Under the directory ~/.vim create another directory namely, syntax, and put there the syntax file.
- Last thing to do is to put a line in your ~/.gvimrc:
au BufRead,BufNewFile *.sv set filetype=sv
- This is the file I use for systemverilog syntax: systemverilog syntax
- Another vim alias, which is handy, is manual specmansyntax enable: manual specman syntax enable
|