fix(nvim): treesitter textobject bindings for Go
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
8d45a4cc6e
commit
68acd1fcac
@ -40,15 +40,15 @@ require("nvim-treesitter.configs").setup({
|
|||||||
enable = true,
|
enable = true,
|
||||||
lookahead = true,
|
lookahead = true,
|
||||||
keymaps = {
|
keymaps = {
|
||||||
["ak"] = "@keyed_element.outer",
|
["ak"] = "@kv_element.all",
|
||||||
["iv"] = "@keyed_element.inner",
|
["ik"] = "@kv_element.key",
|
||||||
["av"] = "@keyed_element.inner",
|
["iv"] = "@kv_element.value",
|
||||||
|
["av"] = "@kv_element.all",
|
||||||
["at"] = "@composite_literal",
|
["at"] = "@composite_literal",
|
||||||
["ia"] = "@parameter.inner",
|
["ia"] = "@parameter.inner",
|
||||||
["aa"] = "@parameter.outer",
|
["aa"] = "@parameter.outer",
|
||||||
["ac"] = "@comment.outer",
|
["ac"] = "@comment.outer",
|
||||||
["as"] = "@statement.outer",
|
["as"] = "@statement.outer",
|
||||||
["ar"] = "@return",
|
|
||||||
["af"] = "@function.outer",
|
["af"] = "@function.outer",
|
||||||
["if"] = "@function.inner",
|
["if"] = "@function.inner",
|
||||||
},
|
},
|
||||||
|
@ -4,8 +4,14 @@
|
|||||||
;; @keyed_element.outer => key and value
|
;; @keyed_element.outer => key and value
|
||||||
;; @keyed_element.inner => value
|
;; @keyed_element.inner => value
|
||||||
|
|
||||||
(keyed_element (_) . (_) @keyed_element.inner) @keyed_element.outer
|
(keyed_element . ((_) @kv_element.key))
|
||||||
(field_declaration type: (_) @keyed_element.inner) @keyed_element.outer
|
(keyed_element ((_) @kv_element.value) .)
|
||||||
(parameter_declaration type: (_) @keyed_element.inner) @keyed_element.outer
|
(keyed_element) @kv_element.all
|
||||||
|
|
||||||
(composite_literal (_)) @composite_literal
|
(parameter_declaration) @kv_element.all
|
||||||
|
(parameter_declaration . ((_) @kv_element.key))
|
||||||
|
(parameter_declaration ((_) @kv_element.value) .)
|
||||||
|
|
||||||
|
(field_declaration) @kv_element.all
|
||||||
|
(field_declaration . ((_) @kv_element.key))
|
||||||
|
(field_declaration ((_) @kv_element.value) .)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user