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

[Feature request] - Support nvim-treesitter highlight groups #250

Open
ckipp01 opened this issue Mar 9, 2021 · 7 comments
Open

[Feature request] - Support nvim-treesitter highlight groups #250

ckipp01 opened this issue Mar 9, 2021 · 7 comments

Comments

@ckipp01
Copy link

ckipp01 commented Mar 9, 2021

It'd be great to see the nvim-treesitter groups covered by onedark. I see that they are all listed here: https://github.com/nvim-treesitter/nvim-treesitter/blob/a74da044a8c208177c0af56eeab709859e2fda38/plugin/nvim-treesitter.vim#L30-L84

I'm not 100% sure how many of these would just be fine as is, but I thought it might be worth a feature request to look through them all and possibly add direct support for them. I thought of this as I saw another colorscheme advertising it: https://github.com/sainnhe/edge/blob/777ff7f61242a6a71ba96374e3007253279f2a20/colors/edge.vim#L322-L369

Thanks for all your work! onedark is still easily my favorite scheme I've used.

@dagadbm
Copy link

dagadbm commented Apr 7, 2021

yes pls :D

@joshdick
Copy link
Owner

joshdick commented Apr 11, 2021

The lines in the nvim-treesitter source you linked do highlight default links back to default/fallback highlight groups that are already styled by onedark.vim.

I haven't gotten around to trying nvim-treesitter yet which is why this issue has languished (my apologies!) but are the fallbacks already included in nvim-treesitter suboptimal/not good enough?

@dagadbm
Copy link

dagadbm commented Apr 11, 2021 via email

@ckipp01
Copy link
Author

ckipp01 commented Apr 11, 2021

I haven't gotten around to trying nvim-treesitter yet which is why this issue has languished (my apologies!) but are the fallbacks already included in nvim-treesitter suboptimal/not good enough?

Honestly, I haven't looked into it that deeply, and I did see that there were fallback, but wasn't 100% sure that everything was covered. 😬 I didn't know how wide spread all fo them were. I'd say that if you do have them all covered, then just go ahead and close this.

@dansdantas
Copy link

dansdantas commented Apr 17, 2021

Colors were looking way awful to me, at least on ruby files, so i copied and pasted some changes that i'm trying to adjust on oceanic-next and looks better now. Not sure if i broke something in other places.

before:
image

after:
image

diff:

diff --git a/colors/onedark.vim b/colors/onedark.vim
index ce0f756..3dcf0e5 100644
--- a/colors/onedark.vim
+++ b/colors/onedark.vim
@@ -576,6 +576,56 @@ call s:h("mkdURL", { "fg": s:cyan, "gui": "underline", "cterm": "underline" })
 call s:h("diffAdded", { "fg": s:green })
 call s:h("diffRemoved", { "fg": s:red })
 
+" nvim-treesitter/nvim-treesitter {{{
+
+highlight! link TSAnnotation Purple
+highlight! link TSAttribute Yellow
+highlight! link TSBoolean Yellow
+highlight! link TSCharacter Green
+highlight! link TSComment Grey
+highlight! link TSConditional Purple
+highlight! link TSConstBuiltin YellowItalic
+highlight! link TSConstMacro Cyan
+highlight! link TSConstant YellowItalic
+highlight! link TSConstructor Fg
+highlight! link TSError ErrorText
+highlight! link TSException Red
+highlight! link TSField Blue
+highlight! link TSFloat Yellow
+highlight! link TSFuncBuiltin Blue
+highlight! link TSFuncMacro Blue
+highlight! link TSFunction Blue
+highlight! link TSInclude Purple
+highlight! link TSKeyword Purple
+highlight! link TSKeywordFunction Purple
+highlight! link TSLabel Purple
+highlight! link TSMethod Blue
+highlight! link TSNamespace Fg
+highlight! link TSNumber Yellow
+highlight! link TSOperator Orange
+highlight! link TSParameter CyanItalic
+highlight! link TSParameterReference CyanItalic
+highlight! link TSProperty Fg
+highlight! link TSPunctBracket Fg
+highlight! link TSPunctDelimiter Cyan
+highlight! link TSPunctSpecial Cyan
+highlight! link TSRepeat Purple
+highlight! link TSString Green
+highlight! link TSStringEscape Yellow
+highlight! link TSStringRegex Yellow
+highlight! link TSStructure RedItalic
+highlight! link TSTag RedItalic
+highlight! link TSTagDelimiter Purple
+highlight! link TSText Green
+" call edge#highlight('TSEmphasis', s:palette.none, s:palette.none, 'bold')
+" call edge#highlight('TSUnderline', s:palette.none, s:palette.none, 'underline')
+highlight! link TSType Yellow
+highlight! link TSTypeBuiltin RedItalic
+highlight! link TSURI markdownUrl
+highlight! link TSVariable Fg
+highlight! link TSVariableBuiltin YellowItalic
+highlight! link TSSymbol Green
+
 " }}}
 
 " Git Highlighting {{{

@navarasu
Copy link
Contributor

@ckipp01 @dagadbm If you are using Neovim 0.5 version, you can also try this Lua port of onedark navarasu/onedark.nvim. Actually, I handpicked and verified the one dark colors for each nvim-treesitter highlight to leverage the benefit of treesitter

@dagadbm
Copy link

dagadbm commented Jul 26, 2021 via email

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

5 participants