replace vim-expand-region with built-in nvim-treesitter functionality

as a bonus, this seems to work somewhat better being LSP-based
This commit is contained in:
Gered 2024-09-30 14:38:32 -04:00
parent de8476a186
commit e7fc7d3a7a
3 changed files with 7 additions and 30 deletions

View file

@ -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" }
}

View file

@ -47,6 +47,13 @@ return {
additional_vim_regex_highlighting = { 'ruby' },
},
indent = { enable = true, disable = { 'ruby' } },
incremental_selection = {
enable = true,
keymaps = {
node_incremental = '<C-A-Up>',
node_decremental = '<C-A-Down>',
},
},
},
-- 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:

View file

@ -1,29 +0,0 @@
return {
{
'terryma/vim-expand-region',
keys = {
{ 'v', mode = { 'x' }, '<Plug>(expand_region_expand)', desc = 'expand_region_expand' },
{ 'V', mode = { 'x' }, '<Plug>(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,
},
}