mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 03:10:04 -04:00
Add tree-sitter-regex
This might be interesting for injected highlighting
This commit is contained in:
parent
a067924507
commit
45ea0df21a
3 changed files with 37 additions and 0 deletions
|
|
@ -180,6 +180,7 @@ List of currently supported languages:
|
||||||
- [ ] yaml
|
- [ ] yaml
|
||||||
- [ ] nix
|
- [ ] nix
|
||||||
- [ ] markdown
|
- [ ] markdown
|
||||||
|
- [x] regex (maintained by @theHamsta)
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
Before doing anything run `:checkhealth nvim_treesitter`. This will help you find where the bug might come from.
|
Before doing anything run `:checkhealth nvim_treesitter`. This will help you find where the bug might come from.
|
||||||
|
|
|
||||||
|
|
@ -203,6 +203,13 @@ parsers.nix = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parsers.regex = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/tree-sitter/tree-sitter-regex",
|
||||||
|
files = { "src/parser.c" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
-- @enable can be true or false
|
-- @enable can be true or false
|
||||||
-- @disable is a list of languages, only relevant if enable is true
|
-- @disable is a list of languages, only relevant if enable is true
|
||||||
-- @keymaps list of user mappings for a given module if relevant
|
-- @keymaps list of user mappings for a given module if relevant
|
||||||
|
|
|
||||||
29
queries/regex/highlights.scm
Normal file
29
queries/regex/highlights.scm
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
;; Forked from tree-sitter-regex
|
||||||
|
;; The MIT License (MIT) Copyright (c) 2014 Max Brunsfeld
|
||||||
|
[
|
||||||
|
"("
|
||||||
|
")"
|
||||||
|
"(?"
|
||||||
|
"(?:"
|
||||||
|
"(?<"
|
||||||
|
">"
|
||||||
|
"["
|
||||||
|
"]"
|
||||||
|
"{"
|
||||||
|
"}"
|
||||||
|
] @punctuation.bracket
|
||||||
|
|
||||||
|
(group_name) @property
|
||||||
|
|
||||||
|
[
|
||||||
|
(identity_escape)
|
||||||
|
(control_letter_escape)
|
||||||
|
(character_class_escape)
|
||||||
|
(control_escape)
|
||||||
|
(start_assertion)
|
||||||
|
(end_assertion)
|
||||||
|
(boundary_assertion)
|
||||||
|
(non_boundary_assertion)
|
||||||
|
] @escape
|
||||||
|
|
||||||
|
[ "*" "+" "|" "=" "<=" "!" "<!" ] @operator
|
||||||
Loading…
Add table
Add a link
Reference in a new issue