No syntax highlighting for curly and square braces? #45

Closed
asgeo1 opened this Issue Mar 21, 2012 · 11 comments

Projects

None yet

8 participants

@asgeo1

Is it just me, or does the syntax highlighting included here not highlight curly and square braces?

The stock JS syntax file in Vim highlights the curly and square braces (but not normal parenthesis) fine - I figured this one would too!

Tested with both gVim and console vim with solarized and ir_black color schemes.

@int3
Collaborator

Yep, there's nothing in the code that highlights these braces. Perhaps we should add them in. @pangloss, what do you think?

@mattsacks

I added highlighting of curly braces in my fork but I couldn't get it to work without removing some of the fold mechanisms in place for set fdm=syntax. Let me know if you'd like me to make a pull request for this.

@DelvarWorld

I vote for this. I'm using rainbows parenthesis right now to mitigate

@goatslacker
Collaborator

I wouldn't mind having this behind some sort of flag but not as the default.

@amadeus
Collaborator

This feature has now been added with the recent updates via the Noise group. However, it probably wouldn't be a bad idea to actually separate them out, then map back to Noise.

I can put together a small pull req if interested.

Otherwise this issue should probably be closed.

@qstrahl
Collaborator

This feature has now been added with the recent updates via the Noise group. However, it probably wouldn't be a bad idea to actually separate them out, then map back to Noise.

👍 Very true. Not all people will want parens/brackets/braces grouped with the rest of the noise. I think this is a job for a config option or @amadeus's fork

@amadeus
Collaborator

I would recommend against anyone using my fork at the moment, it's kind of a mess right now :).

That said however, I did create a pull req to isolate these out #92

@goatslacker
Collaborator

Fixed by e193b66

@zxlin

Pardon the ignorance, how do I enable syntax highlighting for braces, because it is still not colored for me. Thanks in advance for the pointer!

@amadeus
Collaborator

@zxlin you need to assign a color to either the main group Noise or to the individual groups themselves (if you want different colors for say square brackets vs curly brackets).

To assign a color to the Noise group, do the following in your .vimrc:

hi Noise guifg=#8200a8 guibg=NONE gui=NONE

guifg is for text color
guibg is for background color
gui is where you can apply bold, italic, inverse, or underline

To assign colors to the separate groups themselves, you'd do the following:

" [ ]
hi jsBrackets  guifg=#8200a8 guibg=NONE gui=NONE
" ( )
hi jsParen     guifg=#8200a8 guibg=NONE gui=NONE
" { } - for object definitions only
hi jsBlock     guifg=#8200a8 guibg=NONE gui=NONE
" { } - for function definitions only
hi jsFuncBlock guifg=#8200a8 guibg=NONE gui=NONE
@zxlin

@amadeus thank you very much for the pointer!
It didn't work initially because I'm using xterm-256color.
Some research yielded the suggestion of using cterm* instead of gui* settings which worked like a charm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment