feat(treesitter): added incremental selection

This commit is contained in:
Folke Lemaitre 2023-01-16 21:17:04 +01:00
parent bf31eccae2
commit 3af1922f21
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -3,9 +3,12 @@ return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
event = "BufReadPost",
keys = {
{ "<c-space>", desc = "Increment selection" },
{ "<c-bs>", desc = "Schrink selection" },
},
---@type TSConfig
opts = {
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
context_commentstring = { enable = true, enable_autocmd = false },
@ -26,6 +29,15 @@ return {
"vim",
"yaml",
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-space>",
node_incremental = "<C-space>",
scope_incremental = false,
node_decremental = "<C-bs>",
},
},
},
---@param opts TSConfig
config = function(plugin, opts)