aboutsummaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorSten Laane <21343173+StenAL@users.noreply.github.com>2025-12-31 08:59:16 +0200
committerChristian Clason <ch.clason+github@icloud.com>2026-01-03 11:29:39 +0100
commit433779916223596dce3ea64f4b77300c3aa2bfdc (patch)
tree7243819a4eaded7506d8521825a8dbde9491dcad /runtime
parentfix(ruby): improve highlights for pattern matching and for...in loops (diff)
downloadnvim-treesitter-433779916223596dce3ea64f4b77300c3aa2bfdc.tar
nvim-treesitter-433779916223596dce3ea64f4b77300c3aa2bfdc.tar.gz
nvim-treesitter-433779916223596dce3ea64f4b77300c3aa2bfdc.tar.bz2
nvim-treesitter-433779916223596dce3ea64f4b77300c3aa2bfdc.tar.lz
nvim-treesitter-433779916223596dce3ea64f4b77300c3aa2bfdc.tar.xz
nvim-treesitter-433779916223596dce3ea64f4b77300c3aa2bfdc.tar.zst
nvim-treesitter-433779916223596dce3ea64f4b77300c3aa2bfdc.zip
feat(bash): add indents query
It's pretty basic at the moment but already makes working with bash scripts way easier.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/queries/bash/indents.scm32
1 files changed, 32 insertions, 0 deletions
diff --git a/runtime/queries/bash/indents.scm b/runtime/queries/bash/indents.scm
new file mode 100644
index 000000000..c0a4bed47
--- /dev/null
+++ b/runtime/queries/bash/indents.scm
@@ -0,0 +1,32 @@
+[
+ (if_statement)
+ (for_statement)
+ (while_statement)
+ (case_statement)
+ (function_definition)
+ (compound_statement)
+ (subshell)
+ (command_substitution)
+ (do_group)
+ (case_item)
+] @indent.begin
+
+[
+ "fi"
+ "done"
+ "esac"
+ "}"
+ ")"
+ "then"
+ "do"
+ (elif_clause)
+ (else_clause)
+] @indent.branch
+
+[
+ "fi"
+ "done"
+ "esac"
+ "}"
+ ")"
+] @indent.end