I've noticed that some of the themes in helix are using undocumented highlight selectors. Well that's no surprise, these are comming from highlight.scm files in tree-sitter grammars, while the least terrible reference to these classes seems to be https://docs.helix-editor.com/themes.html
We can do better. So first I'm going to just start collecting notes from existing grammars. Two main things will be here: references to "standard" classes, and also guidance for how to change "non-standard" classes.
Current doc source: https://github.com/helix-editor/helix/blob/master/book/src/themes.md
-
attribute
- Class attributes, HTML tag attributes -
type
- Typesbuiltin
- Primitive types provided by the language (int
,usize
)parameter
- Generic type parameters (T
)enum
variant
-
constructor
-
constant
(TODO: constant.other.placeholder for%v
)builtin
Special constants provided by the language (true
,false
,nil
etc)boolean
character
escape
numeric
(numbers)integer
float
-
string
(TODO: string.quoted.{single, double}, string.raw/.unquoted)?regexp
- Regular expressionsspecial
path
url
symbol
- Erlang/Elixir atoms, Ruby symbols, Clojure keywords
-
comment
- Code commentsline
- Single line comments (//
)block
- Block comments (e.g. (/* */
)documentation
- Documentation comments (e.g.///
in Rust)
-
variable
- Variablesbuiltin
- Reserved language variables (self
,this
,super
, etc.)parameter
- Function parametersother
member
- Fields of composite data types (e.g. structs, unions)
-
label
-
punctuation
delimiter
- Commas, colonsbracket
- Parentheses, angle brackets, etc.special
- String interpolation brackets.
-
keyword
control
conditional
-if
,else
repeat
-for
,while
,loop
import
-import
,export
return
exception
operator
-or
,in
directive
- Preprocessor directives (#if
in C)function
-fn
,func
storage
- Keywords describing how things are storedtype
- The type of something,class
,function
,var
,let
, etc.modifier
- Storage modifiers likestatic
,mut
,const
,ref
, etc.
-
operator
-||
,+=
,>
-
function
builtin
method
macro
special
(preprocessor in C)
-
tag
- Tags (e.g.<body>
in HTML)builtin
-
namespace
-
special
-
markup
heading
marker
- the1
,2
,3
,4
,5
,6
- heading text for h1 through h6
list
unnumbered
numbered
checked
unchecked
bold
italic
strikethrough
link
url
- URLs pointed to by linkslabel
- non-URL link referencestext
- URL and image descriptions in links
quote
raw
- verbatim code or equationsinline
block
-
diff
- version control changesplus
- additionsgutter
- gutter indicator UNUSED
minus
- deletionsgutter
- gutter indicator UNUSED
delta
- modificationsmoved
- renamed or moved files/changesgutter
- gutter indicator UNUSED
boolean
->constant.builtin.boolean
repeat
->keyword.control.repeat
, or possiblyfunction.builtin