From e420aa56d7f7e2e24835c869240311987fdeaf34 Mon Sep 17 00:00:00 2001 From: archseer Date: Tue, 15 Feb 2022 05:05:05 +0000 Subject: [PATCH] deploy: ab2a0f325b906574698933824b381ed65c7482a3 --- guides/textobject.html | 12 ++++++++++++ keymap.html | 6 ++++++ print.html | 40 ++++++++++++++++++++++++++++++++++++---- searchindex.js | 2 +- searchindex.json | 2 +- usage.html | 22 ++++++++++++++++++---- 6 files changed, 74 insertions(+), 10 deletions(-) diff --git a/guides/textobject.html b/guides/textobject.html index c5d323b9f..5377efe93 100644 --- a/guides/textobject.html +++ b/guides/textobject.html @@ -157,6 +157,18 @@ for example).

parameter.inside

Example query files can be found in the helix GitHub repository.

+

Queries for Textobject Based Navigation

+

Tree-sitter based navigation is done using captures in the +following order:

+ +

For example if a function.around capture has been already defined for a language +in it's textobjects.scm file, function navigation should also work automatically. +function.movement should be defined only if the node captured by function.around +doesn't make sense in a navigation context.

diff --git a/keymap.html b/keymap.html index e571faa6a..47102ac91 100644 --- a/keymap.html +++ b/keymap.html @@ -366,6 +366,12 @@ and textobject usage.

]dGo to next diagnostic (LSP)goto_next_diag [DGo to first diagnostic in document (LSP)goto_first_diag ]DGo to last diagnostic in document (LSP)goto_last_diag +]fGo to next function (TS)goto_next_function +[fGo to previous function (TS)goto_prev_function +]cGo to next class (TS)goto_next_class +[cGo to previous class (TS)goto_prev_class +]pGo to next parameter (TS)goto_next_parameter +[pGo to previous parameter (TS)goto_prev_parameter [spaceAdd newline aboveadd_newline_above ]spaceAdd newline belowadd_newline_below diff --git a/print.html b/print.html index b92d2acfb..d07a7ca2a 100644 --- a/print.html +++ b/print.html @@ -228,10 +228,24 @@ on the closest pairs found and selections are not required; use counts to act in cClass pParameter -

Note: f, c, etc need a tree-sitter grammar active for the current -document and a special tree-sitter query file to work properly. Only -some grammars -currently have the query file implemented. Contributions are welcome !

+
+

NOTE: f, c, etc need a tree-sitter grammar active for the current +document and a special tree-sitter query file to work properly. Only +some grammars currently have the query file implemented. +Contributions are welcome!

+
+

Tree-sitter Textobject Based Navigation

+

Navigating between functions, classes, parameters, etc is made +possible by leveraging tree-sitter and textobjects queries. For +example to move to the next function use ]f, to move to previous +class use [c, and so on.

+

tree-sitter-nav-demo

+

See the unimpaired section of the keybind +documentation for the full reference.

+
+

NOTE: This feature is dependent on tree-sitter based textobjects +and therefore requires the corresponding query file to work properly.

+

Keymap