-
Notifications
You must be signed in to change notification settings - Fork 454
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
Neovim: Update tree-sitter support for CSS #289
base: master
Are you sure you want to change the base?
Conversation
hi! link TSPunctDelimiter DraculaPink | ||
hi! link TSType DraculaPink | ||
hi! link TSProperty DraculaCyan | ||
hi! link TSError DraculaOrange |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is going to be the proper way to go about this. TSType
, for example, is the token used for all type
s, in every language. That for the most part should be DraculaCyan
..
The way we need to go about this is be specific to these changes just for css languages. There's a way to target those languages specifically, but you'll have to look into the docs for the tree sitter plugin to find that out because I can't recall off the top of my head how to do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seconded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, you might make some queries for that.
For example, create queries/css/highlights.scm
in the plugin's directory like this:
; inherits: css
[
"#"
","
"."
":"
"::"
";"
] @keyword
(class_name) @type
(property_name) @type
(nesting_selector) @keyword
This will partially do the thing you did w/out linking any highlight groups 👽
p.s. you might find helpful :TSPlaygroundToggle
, :TSNodeUnderCursor
and TSHighlightCapturesUnderCursor
commands of the nvim-treesitter/playground
addon on your way.
someone working on this as there is stilll no css highlighting in neovim? |
Neither Derek nor I is working on it, I believe. We requested some changes which have not been implemented. |
Hello!
I found that dracula/vim worked well with HTML & JS via tree-sitter but not CSS. So I took some time to add some highlights for it; I tried to make it look like Vscode as much as possible.
What I linked:
,
,.
,;
, etc. become pink:TSPunctDelimiter
->DraculaPink
TSType
->DraculaPink
TSProperty
->DraculaCyan
TSError
->DraculaOrange
(I was inspired by how shaunsingh/nord.nvim did it)Before:
After: