From e7fc7d3a7a915b5f22f52a719271cc3f367c9708 Mon Sep 17 00:00:00 2001 From: gered Date: Mon, 30 Sep 2024 14:38:32 -0400 Subject: [PATCH] replace vim-expand-region with built-in nvim-treesitter functionality as a bonus, this seems to work somewhat better being LSP-based --- nvim/lazy-lock.json | 1 - nvim/lua/plugins/nvim-treesitter.lua | 7 +++++++ nvim/lua/plugins/vim-expand-region.lua | 29 -------------------------- 3 files changed, 7 insertions(+), 30 deletions(-) delete mode 100644 nvim/lua/plugins/vim-expand-region.lua diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 99f0312..1016892 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -46,7 +46,6 @@ "toggleterm.nvim": { "branch": "main", "commit": "137d06fb103952a0fb567882bb8527e2f92d327d" }, "tokyonight.nvim": { "branch": "main", "commit": "817bb6ffff1b9ce72cdd45d9fcfa8c9cd1ad3839" }, "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" }, - "vim-expand-region": { "branch": "master", "commit": "966513543de0ddc2d673b5528a056269e7917276" }, "vim-sleuth": { "branch": "master", "commit": "cd9d382e33bb817abe7f10cdc3a606bf1d491d75" }, "which-key.nvim": { "branch": "main", "commit": "bfec3d6bc0a9b0b2cb11644642f78c2c3915eef0" } } diff --git a/nvim/lua/plugins/nvim-treesitter.lua b/nvim/lua/plugins/nvim-treesitter.lua index cedec6b..417c9d5 100644 --- a/nvim/lua/plugins/nvim-treesitter.lua +++ b/nvim/lua/plugins/nvim-treesitter.lua @@ -47,6 +47,13 @@ return { additional_vim_regex_highlighting = { 'ruby' }, }, indent = { enable = true, disable = { 'ruby' } }, + incremental_selection = { + enable = true, + keymaps = { + node_incremental = '', + node_decremental = '', + }, + }, }, -- There are additional nvim-treesitter modules that you can use to interact -- with nvim-treesitter. You should go explore a few and see what interests you: diff --git a/nvim/lua/plugins/vim-expand-region.lua b/nvim/lua/plugins/vim-expand-region.lua deleted file mode 100644 index 5af7df9..0000000 --- a/nvim/lua/plugins/vim-expand-region.lua +++ /dev/null @@ -1,29 +0,0 @@ -return { - { - 'terryma/vim-expand-region', - keys = { - { 'v', mode = { 'x' }, '(expand_region_expand)', desc = 'expand_region_expand' }, - { 'V', mode = { 'x' }, '(expand_region_shrink)', desc = 'expand_region_shrink' }, - }, - init = function() - vim.cmd [[ - let g:expand_region_text_objects = { - \ 'iw' :0, - \ 'iW' :0, - \ 'i"' :0, - \ 'i''' :0, - \ 'i]' :1, - \ 'ib' :1, - \ 'iB' :1, - \ 'il' :1, - \ 'ii' :1, - \ 'ip' :0, - \ 'ie' :0, - \ 'a]' :1, - \ 'ab' :1, - \ 'aB' :1, - \ } - ]] - end, - }, -}