From f115d0ebaa7f7331ba2a98411f9cde18822cf7a5 Mon Sep 17 00:00:00 2001 From: kiyan42 Date: Mon, 19 Oct 2020 21:32:54 +0200 Subject: update docs --- README.md | 13 ++++ doc/nvim-treesitter.txt | 162 ++++++++++++++++-------------------------------- 2 files changed, 65 insertions(+), 110 deletions(-) diff --git a/README.md b/README.md index eae29a25b..de2589c34 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ provides two command to tackle this issue: - `TSInstall {language}` to install one or more parsers. `TSInstall ` will give you a list of supported languages, or select `all` to install them all. - `TSInstallInfo` to know which parser is installed. +- `TSUpdate` to update already installed parsers Let's say you need parsers for `lua`, this is how you install it: @@ -153,6 +154,18 @@ require'nvim-treesitter.configs'.setup { } ``` +## Indentation + +Treesitter based indentation (`=` vim behavior) + +```lua +require'nvim-treesitter.config'.setup { + indent = { + enable = true + } +} +``` + # External modules Other modules can be installed as plugins. diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt index 9e8ef71ae..c8b789643 100644 --- a/doc/nvim-treesitter.txt +++ b/doc/nvim-treesitter.txt @@ -155,129 +155,25 @@ Supported options: } EOF < ------------------------------------------------------------------------------- -TEXT OBJECTS *nvim-treesitter-textobjects-mod* - -Syntax aware |text-objects|. - - *nvim-treesitter-text-objects-select-submod* -Text object selection~ - -Define your own text objects mappings -similar to `ip` (inner paragraph) and `ap` (a paragraph). - -Query files: `textobjects.scm`. -Supported options: -- enable: `true` or `false`. -- disable: list of languages. -- keymaps: map of keymaps to a tree-sitter query - (`(function_definition) @function`) or capture group (`@function.inner`). -> - lua < - lua <a"] = "@parameter.inner", - }, - swap_previous = { - ["A"] = "@parameter.inner", - }, - }, - }, - } - EOF -< - - *nvim-treesitter-text-objects-move-submod* -Go to next/previous text object~ +------------------------------------------------------------------------------ +INDENTATION *nvim-treesitter-indentation-mod* -Define your own mappings to jump to the next or previous text object. -This is similar to |]m|, |[m|, |]M|, |[M| Neovim's mappings to jump to the next -or previous function. +Indentation based on treesitter for the |=| operator -Query files: `textobjects.scm`. +Query files: `indents.scm`. Supported options: - enable: `true` or `false`. - disable: list of languages. -- goto_next_start: map of keymaps to a tree-sitter capture group (`@function.outer`). -- goto_next_end: same as goto_next_start, but it jumps to the start of - the text object. -- goto_previous_start: same as goto_next_start, but it jumps to the previous - text object. -- goto_previous_end: same as goto_next_end, but it jumps to the previous - text object. - > lua <