-
-
Notifications
You must be signed in to change notification settings - Fork 273
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
Add support for nvim-treesitter/nvim-treesitter #253
Add support for nvim-treesitter/nvim-treesitter #253
Conversation
Co-Authored-By: Arctic Ice Studio <[email protected]>
Added custom highlight groups of the `vim-startify` (1) plugin to adapt to Nord's style. References: (1) https://github.com/mhinz/vim-startify Resolves GH-159
Vim version 8.1.2029 [1] added the `underline` attribute for the `CursorLineNr` group to `cterm` [2] based on vim/vim#4933 [3]. This change resulted in gutter line numbers being underlined which has now been reverted back to Nord's style by explicitly setting the attribute for the group to `NONE`. [1]: https://github.com/vim/vim/releases/tag/v8.1.2029 [2]: vim/vim@d9b0d83...017ba07#diff-80fffb3e9c20e93e5b2328a9a20e19c9 [3]: vim/vim#4933 Resolves GH-174
Added highlighting support for the build-in Neovim language server [1] using the coc.nvim [2] groups as reference. [1]: https://github.com/neovim/nvim-lsp [2]: https://github.com/neoclide/coc.nvim
…sole and GUI modes. (#202) Consistent `Error` and `MoreMsg` highligh. in term and GUI mode (#202) Before the `Error` group in GUI mode used `nord0` as foreground color instead of `nord4` resulting in a bad contrast. Also after checking ( links to it) Also since there was also no color defined for terminal mode for the `MoreMsg` group (see `:help MoreMsg` that link to `:help more-prompt`) Vim used the default color which was some kind of green. To ensure it matches Nord's style it has now been changed to use `nord8` (main accent color) for both terminal and GUI mode. This can be tested by running `:echon "MESSAGE\n"` taht produces a lot of lines that won't fit on the current screen space anymore. Co-authored-by: Arctic Ice Studio <[email protected]> Co-authored-by: Sven Greb <[email protected]>
The `LineNr` and `CursorLineNr` highlight groups now have a transparent background in GUI mode. Before it was set to `nord0_gui` which worked fine in most cases. However, some plugins use these highlight groups to render their content in a popup window which can potentially have a different background color. This caused some issues e.g. for the fuzzy search plugin LeaderF [1]. The compatibility with the `g:nord_cursor_line_number_background` theme configuration has been verified to work as expected in both modes when it is set to `0` or `1`. This change is not related to the terminal mode or when using `set notermguicolors` since `ctermbg` for `LineNr` and `CursorLineNr` is set to `NONE` by default. [1]: https://github.com/Yggdroot/LeaderF
Added highlighting support for the build-in Neovim language server [1] using the coc.nvim [2] groups as reference. [1]: https://github.com/neovim/nvim-lsp [2]: https://github.com/neoclide/coc.nvim
Basic highlighting support for TypeScript & TSX Added basic support to highlight TypeScript & TSX syntax more consistently through the HerringtonDarkholme/yats.vim plugin [1]. This includes improvements to highlight... 1. ...TypeScript interface an class names using `nord7` as foreground, where interfaces also use the bold attribute, to match with structs/classes. 2. ...global methods like e.g. `setTimeout` with `nord8` using the italic attribute to mark it kind of static. 3. ...regular expressions with `nord13` as foreground color instead of the normal color for quoted strings (`nord14`) to make it easier to differ between both. 4. ...global objects like `Error`, `JSON` and `console` with `nord7`. 5. ...primitive/builtin types like `string` with `nord9`. 6. ...TypeScript type references with `nord7`. 7. ...TypeScript specific characters like for type annotations (`:`) and member optionality (`?`) as operator with `nord9`. This also includes improvements for "vanilla" JavaScript elements. [1]: https://github.com/HerringtonDarkholme/yats.vim Resolves GH-208 Co-authored-by: Arctic Ice Studio <[email protected]> Co-authored-by: Sven Greb <[email protected]>
Added basic support for vim-clap [1], a modern and performant generic finder and dispatcher for Vim and NeoVim. [1]: https://github.com/liuchengxu/vim-clap GH-178 Co-authored-by: Arctic Ice Studio <[email protected]> Co-authored-by: Sven Greb <[email protected]>
@dimascyriaco I noticed that too. I took the files from the linked discussion and applied them here as is. Said that, you are right, maybe having just the Treesitter ones makes sense as for now. I will update the PR. |
Another thing I noticed are docstrings in python. They don't seem to be parsed as strings but something else instead. I am unsure as to whether this belongs in this package, in the TreeSitter parser or somewhere else. Any pointers/help would be appreciated. (That is in order to keep the same syntax higlighting style as the current non-TS version) |
@arcticicestudio I was wondering, added it in another comment if this PR makes any sense any more given that all that remains here is already done in treesitter. |
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.
@mrswats Thanks for the clean up ✨
I've added a couple of review comments and suggestions to clarify things and clean up unnecessary definitions.
I'll push commits to add the new custom syntax highlighting groups as soon as all review discussions are resolved, otherwise they might be marked as outdated again and the suggestions can not be merged. |
I think I dealth with all your last set of changes! I can squash all the commits so it's easier to review. At the view least I squashed all these changes that I made in github into one signle commit. |
The new `Decorator` and `Annotation` groups can be used for decorators like `@observe` in TypeScript for annotations like `@Override` in Java. Additionally the new `Variable` group is a more clearly named group for the `Identifier` group. Co-authored-by: Sven Greb <[email protected]> GH-253
Co-authored-by: Sven Greb <[email protected]> GH-253
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.
Alright, let's get this done.
Thanks to all contributors 👍🏻
This is nice! Thanks for the hard work everyone! |
Neovim version 0.5 [1] is a long-time awaited update that introduces features like tree-sitter [2][3] support and native LSP [4][5]. Even though Neovim devides more and more from Vim through specific features like first-class Lua support with custom APIs, the highlighting for tree-sitter is achived through "normal" syntax highlighting groups. Most of the groups are already linked by the nvim-treesitter plugin by default [6] so only a few groups have been adjuated for now to fit the Nord style. [1]: https://github.com/neovim/neovim/releases/tag/v0.5.0 [2]: https://github.com/tree-sitter/tree-sitter [3]: https://github.com/nvim-treesitter/nvim-treesitter [4]: https://neovim.io/doc/user/lsp.html [5]: https://github.com/neovim/nvim-lspconfig [6]: https://github.com/nvim-treesitter/nvim-treesitter/blob/90f15d9/plugin/nvim-treesitter.vim Co-authored-by: Ferran Jovell <[email protected]> Co-authored-by: Arctic Ice Studio <[email protected]> Co-authored-by: Sven Greb <[email protected]> Closes GH-235
Neovim version 0.5 [1] is a long-time awaited update that introduces features like tree-sitter [2][3] support and native LSP [4][5]. Even though Neovim devides more and more from Vim through specific features like first-class Lua support with custom APIs, the highlighting for tree-sitter is achived through "normal" syntax highlighting groups. Most of the groups are already linked by the nvim-treesitter plugin by default [6] so only a few groups have been adjuated for now to fit the Nord style. [1]: https://github.com/neovim/neovim/releases/tag/v0.5.0 [2]: https://github.com/tree-sitter/tree-sitter [3]: https://github.com/nvim-treesitter/nvim-treesitter [4]: https://neovim.io/doc/user/lsp.html [5]: https://github.com/neovim/nvim-lspconfig [6]: https://github.com/nvim-treesitter/nvim-treesitter/blob/90f15d9/plugin/nvim-treesitter.vim Co-authored-by: Ferran Jovell <[email protected]> Co-authored-by: Arctic Ice Studio <[email protected]> Co-authored-by: Sven Greb <[email protected]> Closes nordthemeGH-235
Resolves #235
It adds support for TreeSitter syntax highlighting.