From 678df2d015d30ba42b6477c8535e0e1a960b0e60 Mon Sep 17 00:00:00 2001 From: archseer Date: Sat, 23 Oct 2021 02:41:37 +0000 Subject: [PATCH] deploy: 4ee92cad19cc94f0751f91fa9391d1899353d740 --- 404.html | 2 +- configuration.html | 2 +- from-vim.html | 2 +- guides/index.html | 182 ++++++++++++++++++++++++++++++++++++++ guides/textobject.html | 193 +++++++++++++++++++++++++++++++++++++++++ hooks.html | 8 +- index.html | 2 +- install.html | 2 +- keymap.html | 2 +- print.html | 38 +++++++- remapping.html | 2 +- searchindex.js | 2 +- searchindex.json | 2 +- themes.html | 2 +- usage.html | 15 +++- 15 files changed, 437 insertions(+), 19 deletions(-) create mode 100644 guides/index.html create mode 100644 guides/textobject.html diff --git a/404.html b/404.html index acc239ba4..50c829d76 100644 --- a/404.html +++ b/404.html @@ -78,7 +78,7 @@ diff --git a/configuration.html b/configuration.html index 7909e0a39..7981cb5d7 100644 --- a/configuration.html +++ b/configuration.html @@ -77,7 +77,7 @@ diff --git a/from-vim.html b/from-vim.html index 6647cf403..fc4fb0687 100644 --- a/from-vim.html +++ b/from-vim.html @@ -77,7 +77,7 @@ diff --git a/guides/index.html b/guides/index.html new file mode 100644 index 000000000..ede678f6b --- /dev/null +++ b/guides/index.html @@ -0,0 +1,182 @@ + + + + + + Guides + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+
+

Guides

+

This section contains guides for adding new language server configurations, +tree-sitter grammers, textobject queries, etc.

+ +
+ + +
+
+ + + +
+ + + + + + + + + + + + diff --git a/guides/textobject.html b/guides/textobject.html new file mode 100644 index 000000000..9dea58b21 --- /dev/null +++ b/guides/textobject.html @@ -0,0 +1,193 @@ + + + + + + Adding Textobject Queries + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+
+

Adding Textobject Queries

+

Textobjects that are language specific (like functions, classes, etc) +require an accompanying tree-sitter grammar and a textobjects.scm query file +to work properly. Tree-sitter allows us to query the source code syntax tree +and capture specific parts of it. The queries are written in a lisp dialect. +More information on how to write queries can be found in the official tree-sitter +documentation.

+

Query files should be placed in runtime/queries/{language}/textobjects.scm +when contributing. Note that to test the query files locally you should put +them under your local runtime directory (~/.config/helix/runtime on Linux +for example).

+

The following captures are recognized:

+ + + + + + +
Capture Name
function.inside
function.around
class.inside
class.around
parameter.inside
+

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

+ +
+ + +
+
+ + + +
+ + + + + + + + + + + + diff --git a/hooks.html b/hooks.html index 8655a5680..dc00a912d 100644 --- a/hooks.html +++ b/hooks.html @@ -77,7 +77,7 @@ @@ -146,6 +146,9 @@ +
@@ -155,6 +158,9 @@ + diff --git a/index.html b/index.html index d0f2a6b84..278a134c3 100644 --- a/index.html +++ b/index.html @@ -77,7 +77,7 @@ diff --git a/install.html b/install.html index f4cd582b9..3c8226db1 100644 --- a/install.html +++ b/install.html @@ -77,7 +77,7 @@ diff --git a/keymap.html b/keymap.html index e72097337..b3cfac477 100644 --- a/keymap.html +++ b/keymap.html @@ -77,7 +77,7 @@ diff --git a/print.html b/print.html index d7b971cd8..7b67116f0 100644 --- a/print.html +++ b/print.html @@ -78,7 +78,7 @@ @@ -210,8 +210,9 @@ on the closest pairs found and selections are not required; use counts to act in

Multiple characters are currently not supported, but planned.

Textobjects

-

Currently supported: word, surround.

-

textobject-demo

+

Currently supported: word, surround, function, class, parameter.

+

textobject-demo +textobject-treesitter-demo