Skip to content

Commit

Permalink
fix: fix bash syntax highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
tmillr committed May 28, 2023
1 parent 22fe860 commit 3f74e75
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lua/github-theme/group/modules/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,15 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch

-- Language specific -------------------------------------------------------

-- Bash
['@operator.bash'] = { fg = syn.keyword, style = stl.operators },
['@function.builtin.bash'] = { fg = syn.keyword }, -- Invocations of builtin commands/functions
['@function.call.bash'] = { fg = syn.const },
['@number.bash'] = FALLBACK_OR_NONE,
-- ['@punctuation.bracket.bash'] = { fg = syn.string }, -- $(, (, ), [, ], ((, ))
['@punctuation.delimiter.bash'] = { fg = syn.keyword }, -- ; and ;;
['@punctuation.special.bash'] = { link = "@punctuation.bash" }, -- $

-- C
['@type.c'] = { fg = spec.variable },
['@label.c'] = { fg = spec.variable },
Expand Down
20 changes: 20 additions & 0 deletions queries/bash/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
;; extends

; This should probably have its own unique/custom capture, but this works for
; now.
(command_substitution
[ "$(" ")" ] @string)

; This should probably have its own unique/custom capture, but this works for
; now.
(process_substitution
[ "<(" ")" ] @string)

(expansion
"#" @operator)

(simple_expansion
"$" @variable)

(subscript
index: (word) @punctuation.special (#any-of? @punctuation.special "@" "*"))

0 comments on commit 3f74e75

Please sign in to comment.