Closed hedyhli closed 5 months ago
I'm willing to give this a try. I like this idea for sure!! Thanks
How do you control which highlights.scm file nvim uses for a particular language?
How do you control which highlights.scm file nvim uses for a particular language?
If the Lua plugin in this repo is used, the file will be in queries/nu/
in the runtime. And nvim-treesitter will see the filetype, nu, then fetch queries/<nu>/
in the runtime.
If there are multiple, precendence is determined in a similar manner to $PATH
, as listed in :set rtp?
. Notice how the first path is ~/.config/nvim
, so to have a queries/nu/highlight.scm
file override all others of the same path in the runtime, then put it in ~/.config/nvim/queries/nu/highlight.scm
.
That's very helpful. Thanks
It looks like the highlighting is a bit off now. This is from the toolkit.nu file in the root of the nushell repo.
@hedyhli wondering about your thoughts on this broken highlighting?
@hedyhli will you have an opportunity to look at this issue?
This updates:
:
,,
punctuation.special
variable.member
->
punctuation.special
$
punctuation.special
variable
keyword.directive
type
number
variable.parameter
operator
variable.parameter
[^1]: Note that for built-in types, languages like Rust, Python, Go differentiates highlights of built-in types and other types (such as structs), but there are no other types in Nu, I'll leave this up to debate, IMO a generic type will suffice here.
[^2]: Perl, Fish and Awk all leave these unhighlighted.
Also adds highlights for documentation comments for functions and parameters.
I've tried to put newly introduced highlight queries into the correct groups in the file, let me know if there are any other prevailing styles I should follow!