Skip to content

Commit 3f74e75

Browse files
committed
fix: fix bash syntax highlighting
1 parent 22fe860 commit 3f74e75

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
@@ -151,6 +151,15 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch
151151

152152
-- Language specific -------------------------------------------------------
153153

154+
-- Bash
155+
['@operator.bash'] = { fg = syn.keyword, style = stl.operators },
156+
['@function.builtin.bash'] = { fg = syn.keyword }, -- Invocations of builtin commands/functions
157+
['@function.call.bash'] = { fg = syn.const },
158+
['@number.bash'] = FALLBACK_OR_NONE,
159+
-- ['@punctuation.bracket.bash'] = { fg = syn.string }, -- $(, (, ), [, ], ((, ))
160+
['@punctuation.delimiter.bash'] = { fg = syn.keyword }, -- ; and ;;
161+
['@punctuation.special.bash'] = { link = "@punctuation.bash" }, -- $
162+
154163
-- C
155164
['@type.c'] = { fg = spec.variable },
156165
['@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)