From 5fb6ebdad4e44c21bbe27aba74469fa84e72e34b Mon Sep 17 00:00:00 2001 From: gered Date: Sat, 7 Sep 2024 14:58:07 -0400 Subject: [PATCH] add vim-expand-region --- lazy-lock.json | 1 + lua/plugins/vim-expand-region.lua | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 lua/plugins/vim-expand-region.lua diff --git a/lazy-lock.json b/lazy-lock.json index f05f7be..b3de827 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -46,6 +46,7 @@ "todo-comments.nvim": { "branch": "main", "commit": "319c01b99b7a8c9ac2066bf0efd4d6ec68fef444" }, "toggleterm.nvim": { "branch": "main", "commit": "137d06fb103952a0fb567882bb8527e2f92d327d" }, "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" }, + "vim-expand-region": { "branch": "master", "commit": "966513543de0ddc2d673b5528a056269e7917276" }, "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, "which-key.nvim": { "branch": "main", "commit": "bfec3d6bc0a9b0b2cb11644642f78c2c3915eef0" } } diff --git a/lua/plugins/vim-expand-region.lua b/lua/plugins/vim-expand-region.lua new file mode 100644 index 0000000..5af7df9 --- /dev/null +++ b/lua/plugins/vim-expand-region.lua @@ -0,0 +1,29 @@ +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, + }, +}