Skip to content

Commit 6f2dc7e

Browse files
authored
feat(zsh): add textobjects
copied from bash
1 parent 9e756f8 commit 6f2dc7e

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

queries/zsh/textobjects.scm

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
(function_definition) @function.outer
2+
3+
(function_definition
4+
body: (compound_statement
5+
.
6+
"{"
7+
_+ @function.inner
8+
"}"))
9+
10+
(case_statement) @conditional.outer
11+
12+
(if_statement
13+
(_) @conditional.inner) @conditional.outer
14+
15+
(for_statement
16+
(_) @loop.inner) @loop.outer
17+
18+
(while_statement
19+
(_) @loop.inner) @loop.outer
20+
21+
(comment) @comment.outer
22+
23+
(regex) @regex.inner
24+
25+
((word) @number.inner
26+
(#lua-match? @number.inner "^[0-9]+$"))
27+
28+
(variable_assignment) @assignment.outer
29+
30+
(variable_assignment
31+
name: (_) @assignment.inner @assignment.lhs)
32+
33+
(variable_assignment
34+
value: (_) @assignment.inner @assignment.rhs)
35+
36+
(command
37+
argument: (word) @parameter.inner)

0 commit comments

Comments
 (0)