Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rainbow 'begin/end' Support #204

Open
tnguyen-tx opened this issue Feb 28, 2021 · 8 comments
Open

Rainbow 'begin/end' Support #204

tnguyen-tx opened this issue Feb 28, 2021 · 8 comments

Comments

@tnguyen-tx
Copy link

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.

@vhda
Copy link
Owner

vhda commented Mar 8, 2021

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?

@netvolcano
Copy link

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

@vhda
Copy link
Owner

vhda commented May 10, 2023

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

@netvolcano
Copy link

Snipaste_2023-05-11_10-02-13

With my setting in the rainbow plugin.

@real-bird-kun
Copy link

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

@netvolcano
Copy link

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
Copy link

netvolcano commented Dec 23, 2023

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

@real-bird-kun
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants