From a96fb22d4dfe640f3280b46b86c6e766717d8840 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 26 Feb 2022 19:45:19 +0100 Subject: [PATCH] home: vim: document 'tree-sitter' moves --- .../plugin/mappings/tree-sitter-textobjects.vim | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/home/vim/after/plugin/mappings/tree-sitter-textobjects.vim b/home/vim/after/plugin/mappings/tree-sitter-textobjects.vim index ac960bd..0014975 100644 --- a/home/vim/after/plugin/mappings/tree-sitter-textobjects.vim +++ b/home/vim/after/plugin/mappings/tree-sitter-textobjects.vim @@ -1,7 +1,18 @@ lua << EOF local wk = require("which-key") -local keys = { +local motions = { + ["]m"] = "Next method start", + ["]M"] = "Next method end", + ["]]"] = "Next class start", + ["]["] = "Next class end", + ["[m"] = "Previous method start", + ["[M"] = "Previous method end", + ["[["] = "Previous class start", + ["[]"] = "Previous class end", +} + +local objects = { ["aa"] = "a parameter", ["ia"] = "inner parameter", ["ab"] = "a block", @@ -13,5 +24,6 @@ local keys = { ["ak"] = "a comment", } -wk.register(keys, { mode = "o" }) +wk.register(motions, { mode = "n" }) +wk.register(objects, { mode = "o" }) EOF