verilog_systemverilog.vim
verilog_systemverilog.vim copied to clipboard
Rainbow 'begin/end' Support
Thanks for the awesome plugin. I've tried to match begin/end with matching colors just like rainbow plugin does for parentheses.
However even I changed the parentheses setting in rainbow it still doesn't work
I believe this is due to syntax priority between verilog_systemverilog and rainbow. What should I do to solve this issue? Thanks.
I can't find a way of disabling this highlight on my side, as it is. I've looked at some of those rainbow plugins and some have an "after" option that could be used to overcome this. Could you give it a try?
Try to add the following lines into you rainbow setting (i.e. put them into let s:rainbow_conf = {...}
)
\ 'verilog_systemverilog': {
\ 'parentheses': [
\ 'start=/(/ end=/)/ fold',
\ 'start=/\[/ end=/\]/ fold',
\ 'start=/{/ end=/}/ fold',
\ 'start=/\<begin\>/ end=/\<end\>/',
\ ],
\ 'after': [
\ 'syn clear verilogBeginEnd',
\ 'syn match verilogOperator "[&|~><!*#%@+/=?:;}{,.\^\-\[\]]" ',
\ 'syn region verilogComment start="/\*" end="\*/" contains=verilogTodo,@Spell ',
\ 'syn match verilogComment "//.*" contains=verilogTodo,@Spell ',
\ ],
\ },
@tnguyen-tx did @netvolcano solution work for you?
With my setting in the rainbow plugin.
Try to add the following lines into you rainbow setting (i.e. put them into
let s:rainbow_conf = {...}
)\ 'verilog_systemverilog': { \ 'parentheses': [ \ 'start=/(/ end=/)/ fold', \ 'start=/\[/ end=/\]/ fold', \ 'start=/{/ end=/}/ fold', \ 'start=/\<begin\>/ end=/\<end\>/', \ ], \ 'after': [ \ 'syn clear verilogBeginEnd', \ 'syn match verilogOperator "[&|~><!*#%@+/=?:;}{,.\^\-\[\]]" ', \ 'syn region verilogComment start="/\*" end="\*/" contains=verilogTodo,@Spell ', \ 'syn match verilogComment "//.*" contains=verilogTodo,@Spell ', \ ], \ },
Hi~ I am trying to use your solution, but it doesn't work for me. The error info is in the following picture. Would you please help me figure it out?
My configuration is:
Thank your for your help in advance :)
Have you installed the the verilog syntax plugin as below? Plugin 'vhda/verilog_systemverilog.vim'
If it will not take effects after you installed the plugin, you need delete a line of "syn keyword verilogLabel begin end fork join" from the verilog_systemverilog.vim file in the syntax directory.
You need to modify the below statement in the verilog_systemverilog.vim file in the syntax directory (I think it is the root for your error messages):
# syn keyword verilogStatement begin end
syn keyword verilogStatement begin end
You need to modify the below statement in the verilog_systemverilog.vim file in the syntax directory (I think it is the root for your error messages): # syn keyword verilogStatement begin end syn keyword verilogStatement begin end
Cool, you're totally right. It works. Thanks a lot. I am wondering how your vimrc looks like, because I think you must have a lot great config for writing veirlog/sv efficiently. Anyway, thank you for your help in time :)