From 93f5edc2ad9100c680320985b4083f95ffc50697 Mon Sep 17 00:00:00 2001 From: Robert Morrison Date: Fri, 10 Apr 2026 02:26:18 +0100 Subject: [PATCH] feat(treesitter): Add incremental select for <0.12 This commit adds support for incremental selection when not running nvim-0.12 or later. (As the ability was made a native feature) --- lua/plugins/spec/treesitter.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lua/plugins/spec/treesitter.lua b/lua/plugins/spec/treesitter.lua index 5344a12..9971c45 100644 --- a/lua/plugins/spec/treesitter.lua +++ b/lua/plugins/spec/treesitter.lua @@ -1,3 +1,5 @@ +---@module "lazy.nvim" +---@type LazySpec return { { "nvim-treesitter/nvim-treesitter", @@ -12,4 +14,24 @@ return { "nvim-treesitter/nvim-treesitter", }, }, + { + "MeanderingProgrammer/treesitter-modules.nvim", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + + opts = { + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + scope_incremental = "", + node_incremental = "", + node_decremental = "", + } + } + }, + cond = function () + return (vim.fn.has("nvim-0.12") == 0) + end + } } +