From ffaf12680fd5e97fe09ec4f5bb2acf441b1b8d0f Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Wed, 7 May 2025 20:05:04 +0300 Subject: [PATCH] Replaced treewalker with iswap which works better (like keeping whitespace for cases like switch statements) --- .config/nvim/lazy-lock.json | 2 +- .config/nvim/lua/plugins/iswap.lua | 17 +++++++++++++++++ .config/nvim/lua/plugins/treewalker.lua | 12 ------------ 3 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 .config/nvim/lua/plugins/iswap.lua delete mode 100644 .config/nvim/lua/plugins/treewalker.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 9686a7d..803720d 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -17,6 +17,7 @@ "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, "helpview.nvim": { "branch": "main", "commit": "8df486915a29483c7955067a7c17bffdf3b1e5f5" }, "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, + "iswap.nvim": { "branch": "master", "commit": "e02cc91f2a8feb5c5a595767d208c54b6e3258ec" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, "leap.nvim": { "branch": "main", "commit": "2b68ddc0802bd295e64c9e2e75f18f755e50dbcc" }, @@ -48,7 +49,6 @@ "tiny-inline-diagnostic.nvim": { "branch": "main", "commit": "cd401038de4cbae37651cfe02510294ccf5cdc98" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, - "treewalker.nvim": { "branch": "main", "commit": "34bf0a6044e0b5e3d93b7012ae7bdf457de91ba1" }, "undotree": { "branch": "master", "commit": "b951b87b46c34356d44aa71886aecf9dd7f5788a" }, "vim-illuminate": { "branch": "master", "commit": "fbc16dee336d8cc0d3d2382ea4a53f4a29725abf" }, "vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" }, diff --git a/.config/nvim/lua/plugins/iswap.lua b/.config/nvim/lua/plugins/iswap.lua new file mode 100644 index 0000000..2de3b7a --- /dev/null +++ b/.config/nvim/lua/plugins/iswap.lua @@ -0,0 +1,17 @@ +return { + 'mizlan/iswap.nvim', + event = 'VeryLazy', + keys = { + { 'H', 'IMoveNodeWithLeft', silent = true }, + { 'L', 'IMoveNodeWithRight', silent = true }, + }, + opts = { + -- Post-operation flashing highlight style, + -- either 'simultaneous' or 'sequential', or false to disable + -- default 'sequential' + flash_style = false, + + -- Move cursor to the other element in ISwap*With commands + move_cursor = true, + }, +} diff --git a/.config/nvim/lua/plugins/treewalker.lua b/.config/nvim/lua/plugins/treewalker.lua deleted file mode 100644 index af4992b..0000000 --- a/.config/nvim/lua/plugins/treewalker.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - 'aaronik/treewalker.nvim', - keys = { - { 'H', 'Treewalker SwapLeft', silent = true }, - { 'L', 'Treewalker SwapRight', silent = true }, - }, - opts = { - highlight = true, - highlight_duration = 250, - highlight_group = 'CursorLine', - }, -}