verilog_systemverilog.vim icon indicating copy to clipboard operation
verilog_systemverilog.vim copied to clipboard

Rainbow 'begin/end' Support

Open tnguyen-tx opened this issue 4 years ago • 8 comments

Thanks for the awesome plugin. I've tried to match begin/end with matching colors just like rainbow plugin does for parentheses. image However even I changed the parentheses setting in rainbow it still doesn't work image image I believe this is due to syntax priority between verilog_systemverilog and rainbow. What should I do to solve this issue? Thanks.

tnguyen-tx avatar Feb 28 '21 15:02 tnguyen-tx

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?

vhda avatar Mar 08 '21 22:03 vhda

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 ',
\           ],
\    },

netvolcano avatar Nov 16 '21 07:11 netvolcano

@tnguyen-tx did @netvolcano solution work for you?

vhda avatar May 10 '23 21:05 vhda

Snipaste_2023-05-11_10-02-13

With my setting in the rainbow plugin.

netvolcano avatar May 11 '23 02:05 netvolcano

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? image

My configuration is: image

Thank your for your help in advance :)

real-bird-kun avatar Dec 22 '23 15:12 real-bird-kun

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.

netvolcano avatar Dec 23 '23 06:12 netvolcano

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 image

netvolcano avatar Dec 23 '23 06:12 netvolcano

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 image

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 :)

real-bird-kun avatar Dec 23 '23 15:12 real-bird-kun