diff options
| author | kiyan42 <yazdani.kiyan@protonmail.com> | 2020-05-08 11:22:59 +0200 |
|---|---|---|
| committer | kiyan42 <yazdani.kiyan@protonmail.com> | 2020-05-12 16:16:48 +0200 |
| commit | 45dcebb15f1a954eba2bcb3ae4c1a03f710a1f2a (patch) | |
| tree | 50cbca8e9615d69a8ff9aca6b33a35abb32f9363 /doc | |
| parent | Merge pull request #47 from theHamsta/fix-typo-contributing.md (diff) | |
| download | nvim-treesitter-45dcebb15f1a954eba2bcb3ae4c1a03f710a1f2a.tar nvim-treesitter-45dcebb15f1a954eba2bcb3ae4c1a03f710a1f2a.tar.gz nvim-treesitter-45dcebb15f1a954eba2bcb3ae4c1a03f710a1f2a.tar.bz2 nvim-treesitter-45dcebb15f1a954eba2bcb3ae4c1a03f710a1f2a.tar.lz nvim-treesitter-45dcebb15f1a954eba2bcb3ae4c1a03f710a1f2a.tar.xz nvim-treesitter-45dcebb15f1a954eba2bcb3ae4c1a03f710a1f2a.tar.zst nvim-treesitter-45dcebb15f1a954eba2bcb3ae4c1a03f710a1f2a.zip | |
refacto/feat: better handling of parser updates
features:
- node_movement is moving between scopes.
- add selection initialization from normal mode
- add a decremental selection
improvements:
- attach to buffer to run tree parsing on change
- run state update on CursorMoved
- the buffer state is:
```
{
cursor_pos = { row=row, col=col },
current_node = node_under_cursor,
selection = {
range = nil, -- activates when starting a selection
nodes = {} -- filling up when starting an incremental selection
},
parser = parser, -- parser for current buffer
}
```
- refacto all the modules reliant on parsing the tree, update the current nodes, get the current nodes...
fixes:
- fix has_parser to look for .so libraries
- fix should select the whole file when selection root in selection
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/nvim-treesitter.txt | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt index 084936bad..9c66b0a57 100644 --- a/doc/nvim-treesitter.txt +++ b/doc/nvim-treesitter.txt @@ -31,25 +31,27 @@ By default, everything is disabled. To enable support for features, in your `ini lua <<EOF require'nvim-treesitter.configs'.setup { highlight = { - enable = true, -- false will disable the whole extension - disable = { 'c', 'rust' }, -- list of language that will be disabled + enable = true, -- false will disable the whole extension + disable = { 'c', 'rust' }, -- list of language that will be disabled }, - incremental_selection = { -- this enables incremental selection + incremental_selection = { enable = true, disable = { 'cpp', 'lua' }, keymaps = { -- mappings for incremental selection (visual mappings) - node_incremental = "<leader>e", -- "grn" by default, - scope_incremental = "<leader>f" -- "grc" by default + init_selection = 'gnn', -- maps in normal mode to init the node/scope selection + node_incremental = "grn", -- increment to the upper named parent + scope_incremental = "grc", -- increment to the upper scope (as defined in locals.scm) + scope_decremental = "grm", -- decrement to the previous scope } }, node_movement = { -- this cursor movement in node hierachy enable = true, disable = { 'cpp', 'rust' }, - keymaps = { -- mappings for node movement (normal mappings) - move_up = "<a-k>", -- default is to move with alt key hold - move_down = "<a-j>", - move_left = "<a-h>", - move_right = "<a-l>", + keymaps = { -- mappings for scope movement + parent_scope = "<a-k>", -- default is to move with alt key hold + child_scope = "<a-j>", + next_scope = "<a-h>", + previous_scope = "<a-l>", } }, ensure_installed = 'all' -- one of 'all', 'language', or a list of languages |
