-1

I would like to use vim/gvim to automatically highlight my code file for example .svh/.sv/.txt file and here is my setting picture:

set file of .vimrc

and i source it. But it always failed to automatically highlight the code file.

fix that error with some ways

romainl
  • 186,200
  • 21
  • 280
  • 313

1 Answers1

0

It looks as if Vim does not support verilog files out of the box. You will need to install a plugin (or write one yourself) to make it work.

A quick search found the verilog systemverilog plugin. You might give it a try. I have no experience with it but it seems to be actively maintained.

The plugin will work for *.v,*.vh,*.vp,*.sv,*.svi,*.svh,*.svp,*.sva files. I would not recommend to also use it for *.txt files as this will affect all plain text files.

Friedrich
  • 2,011
  • 2
  • 17
  • 19
  • it did not work. just shows error detected while processing vim +PlugInstall +qall – Matthew MA May 04 '23 at 07:18
  • Did you install a plugin manager ([vim-plug](https://github.com/junegunn/vim-plug) or [Vundle](https://github.com/gmarik/vundle)) first? – Friedrich May 04 '23 at 07:33
  • yes I first add plugin in the vimrc and then commend this line. I think from a server I can not plugin cause I do not have any access. – Matthew MA May 04 '23 at 10:35
  • Plug 'vhda/verilog_systemverilog.vim' I add this in vimrc and then run this code vim +PlugInstall +qall – Matthew MA May 04 '23 at 10:37
  • If you chose to do it without a plugin manager, you don't need to run `PlugInstall`. This would make the manager install the plugins. You don't have a manger and you cannot install. Don't call it! Just make sure you have all the files in the right places. This is on your machine, I won't be able to help you there. – Friedrich May 04 '23 at 10:44
  • yes but my other colleagues can use vim to automatically highlight it. so there should be some ways without plugin – Matthew MA May 04 '23 at 11:41
  • Then my answer obviously will not help you. I would suggest you ask your colleagues how they made it work. Please post an answer once you figure something out that works for you. – Friedrich May 04 '23 at 11:48
  • they are busy I do not have a chance to ask.... – Matthew MA May 04 '23 at 13:34
  • Give me their number, I will call and ask them on your behalf :) – Friedrich May 04 '23 at 13:43