This commit adds support for incremental selection when not running nvim-0.12 or later. (As the ability was made a native feature)
38 lines
690 B
Lua
38 lines
690 B
Lua
---@module "lazy.nvim"
|
|
---@type LazySpec
|
|
return {
|
|
{
|
|
"nvim-treesitter/nvim-treesitter",
|
|
lazy = false,
|
|
branch = "main",
|
|
build = ":TSUpdate",
|
|
setup = true,
|
|
},
|
|
{
|
|
"nvim-treesitter/nvim-treesitter-context",
|
|
dependencies = {
|
|
"nvim-treesitter/nvim-treesitter",
|
|
},
|
|
},
|
|
{
|
|
"MeanderingProgrammer/treesitter-modules.nvim",
|
|
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
|
|
|
opts = {
|
|
incremental_selection = {
|
|
enable = true,
|
|
keymaps = {
|
|
init_selection = "<CR>",
|
|
scope_incremental = "<CR>",
|
|
node_incremental = "<TAB>",
|
|
node_decremental = "<S-TAB>",
|
|
}
|
|
}
|
|
},
|
|
cond = function ()
|
|
return (vim.fn.has("nvim-0.12") == 0)
|
|
end
|
|
}
|
|
}
|
|
|