vhda / verilog_systemverilog.vim

Verilog/SystemVerilog Syntax and Omni-completion
366 stars 89 forks source link

Undefined variable: g:verilog_syntax #237

Closed MinhTran0911 closed 6 months ago

MinhTran0911 commented 6 months ago

I just installed this plugin using Vim Plug by:

  1. Download the entire repo as zip -> Extract -> Copy contents into ~/.vim
  2. Add the following code to ~/.vimrc:
call plug#begin()
Plug 'vhda/verilog_systemverilog.vim'
call plug#end()
  1. Run
%vim +PlugInstall +qall
  1. Then I open a SystemVerilog file (*.sv extension) and get the following error
Error detected while processing /usr/share/vim/vimrc[25]../usr/share/vim/vim82/syntax/syntax.vim[42]..BufRead Autocommands for "*.sv"..FileType Autocommands for "*"..Syntax Autocommands for "*"..function <SNR>4_SynSet[25]..script /home/minh/.vim/syntax/verilog_systemverilog.vim:
line  246:
E121: Undefined variable: g:verilog_syntax
E116: Invalid arguments for function <SNR>10_SyntaxCreate
line  341:
E121: Undefined variable: g:verilog_syntax
E116: Invalid arguments for function <SNR>10_SyntaxCreate
line  246:
E121: Undefined variable: g:verilog_syntax
E116: Invalid arguments for function <SNR>10_SyntaxCreate
line  341:
E121: Undefined variable: g:verilog_syntax
E116: Invalid arguments for function <SNR>10_SyntaxCreate
Press ENTER or type command to continue
  1. I saw a similar issues on this repo and try all recommended debugging steps including comment out the entirety of my .vimrc but still not working (the error does not show when running vim -u NONE -U NONE -N though). Can you help to check this issue?
vhda commented 6 months ago

Step 1 should not be needed if you are using VimPlug to install this plugin. Please move your ~/.vim to another location and re-run steps 2 to 4 and report back if it helps. If it still doesn't work, please share the output of :echo runtimepath. (Note: you should omit your $HOME location to avoid sharing your username online. This is also valid in your original post.)

MinhTran0911 commented 6 months ago

So it turns out that for Vim 8.2, I can only install this using VimPlug. Manual installation does not work. On Vim 7.2 manual installation doesn't seem to be a problem though. Thank you for your help.