Skip to content

Commit 262dbe8

Browse files
committed
fix: bash syntax highlighting
1 parent f59fce7 commit 262dbe8

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

lua/github-theme/group/modules/treesitter.lua

+9
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,15 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch
148148

149149
-- Language specific -------------------------------------------------------
150150

151+
-- Bash
152+
['@operator.bash'] = { fg = syn.keyword, style = stl.operators },
153+
['@function.builtin.bash'] = { fg = syn.keyword }, -- Invocations of builtin commands/functions
154+
['@function.call.bash'] = { fg = syn.const },
155+
['@number.bash'] = FALLBACK_OR_NONE,
156+
-- ['@punctuation.bracket.bash'] = { fg = syn.string }, -- $(, (, ), [, ], ((, ))
157+
['@punctuation.delimiter.bash'] = { fg = syn.keyword }, -- ; and ;;
158+
['@punctuation.special.bash'] = { link = "@punctuation.bash" }, -- $
159+
151160
-- C
152161
['@type.c'] = { fg = spec.variable },
153162
['@label.c'] = { fg = spec.variable },

queries/bash/highlights.scm

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
;; extends
2+
3+
; This should probably have its own unique/custom capture, but this works for
4+
; now.
5+
(command_substitution
6+
[ "$(" ")" ] @string)
7+
8+
; This should probably have its own unique/custom capture, but this works for
9+
; now.
10+
(process_substitution
11+
[ "<(" ")" ] @string)
12+
13+
(expansion
14+
"#" @operator)
15+
16+
(simple_expansion
17+
"$" @variable)
18+
19+
(subscript
20+
index: (word) @punctuation.special (#any-of? @punctuation.special "@" "*"))

0 commit comments

Comments
 (0)