From 02d6a5d5a0ff535eb35e00a20539c40234cfe046 Mon Sep 17 00:00:00 2001 From: aleidk Date: Thu, 26 Oct 2023 16:05:50 -0300 Subject: [PATCH] add surround and toggle nodes to nvim --- config/nvim/lazy-lock.json | 2 +- config/nvim/lua/aleidk/plugins/git.lua | 1 - config/nvim/lua/aleidk/plugins/init.lua | 5 +++ .../nvim/lua/aleidk/plugins/nvim-spider.lua | 13 ------ .../lua/aleidk/plugins/ts-node-action.lua | 41 ++++++++++++------- 5 files changed, 33 insertions(+), 29 deletions(-) delete mode 100644 config/nvim/lua/aleidk/plugins/nvim-spider.lua diff --git a/config/nvim/lazy-lock.json b/config/nvim/lazy-lock.json index 6113089..13f0571 100644 --- a/config/nvim/lazy-lock.json +++ b/config/nvim/lazy-lock.json @@ -37,7 +37,6 @@ "nvim-lint": { "branch": "master", "commit": "962a76877a4479a535b935bd7ef35ad41ba308b2" }, "nvim-lspconfig": { "branch": "master", "commit": "6428fcab6f3c09e934bc016c329806314384a41e" }, "nvim-notify": { "branch": "master", "commit": "e4a2022f4fec2d5ebc79afa612f96d8b11c627b3" }, - "nvim-spider": { "branch": "main", "commit": "28ea1139b3b566187813684a4d37e3da0ce2b888" }, "nvim-tree.lua": { "branch": "master", "commit": "78a9ca5ed6557f29cd0ce203df44213e54bfabb9" }, "nvim-treesitter": { "branch": "master", "commit": "107e61afb7129d637ea6c3c68b97a22194b0bf16" }, "nvim-treesitter-context": { "branch": "master", "commit": "8aa32aa6b84dda357849dbc0f775e69f2e04c041" }, @@ -51,6 +50,7 @@ "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, "telescope.nvim": { "branch": "master", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" }, "todo-comments.nvim": { "branch": "main", "commit": "4a6737a8d70fe1ac55c64dfa47fcb189ca431872" }, + "treesj": { "branch": "main", "commit": "070e6761d0b11a55446d988a69908f7a0928dbab" }, "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, "ts-node-action": { "branch": "master", "commit": "f266409809555d7604b1ba894ffad8958670d04f" }, "vim-fugitive": { "branch": "master", "commit": "cbe9dfa162c178946afa689dd3f42d4ea8bf89c1" }, diff --git a/config/nvim/lua/aleidk/plugins/git.lua b/config/nvim/lua/aleidk/plugins/git.lua index 370e4d9..415e6cf 100644 --- a/config/nvim/lua/aleidk/plugins/git.lua +++ b/config/nvim/lua/aleidk/plugins/git.lua @@ -29,7 +29,6 @@ return { map("n", "p", gs.preview_hunk, "Preview Hunk") map("n", "l", function() gs.blame_line() end, "Blame Line") map("n", "d", gs.diffthis, "Diff This") - map("n", "D", function() gs.diffthis("~") end, "Diff This ~") end, }, }, diff --git a/config/nvim/lua/aleidk/plugins/init.lua b/config/nvim/lua/aleidk/plugins/init.lua index 5101194..fb328ba 100644 --- a/config/nvim/lua/aleidk/plugins/init.lua +++ b/config/nvim/lua/aleidk/plugins/init.lua @@ -41,4 +41,9 @@ return { end, }, { "nvim-treesitter/nvim-treesitter-context" }, + { + "echasnovski/mini.surround", + version = "*", + event = "VeryLazy", + }, } diff --git a/config/nvim/lua/aleidk/plugins/nvim-spider.lua b/config/nvim/lua/aleidk/plugins/nvim-spider.lua deleted file mode 100644 index 2b5b634..0000000 --- a/config/nvim/lua/aleidk/plugins/nvim-spider.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - "chrisgrieser/nvim-spider", - event = "VeryLazy", - config = function() - require("spider").setup({ - skipInsignificantPunctuation = false, - }) - vim.keymap.set({ "n", "o", "x" }, "w", "lua require('spider').motion('w')", { desc = "Spider-w" }) - vim.keymap.set({ "n", "o", "x" }, "e", "lua require('spider').motion('e')", { desc = "Spider-e" }) - vim.keymap.set({ "n", "o", "x" }, "b", "lua require('spider').motion('b')", { desc = "Spider-b" }) - vim.keymap.set({ "n", "o", "x" }, "ge", "lua require('spider').motion('ge')", { desc = "Spider-ge" }) - end, -} diff --git a/config/nvim/lua/aleidk/plugins/ts-node-action.lua b/config/nvim/lua/aleidk/plugins/ts-node-action.lua index dc55988..7dc3ad1 100644 --- a/config/nvim/lua/aleidk/plugins/ts-node-action.lua +++ b/config/nvim/lua/aleidk/plugins/ts-node-action.lua @@ -1,18 +1,31 @@ return { - "ckolkey/ts-node-action", - dependencies = { "nvim-treesitter", "jose-elias-alvarez/null-ls.nvim" }, - config = function() - require("ts-node-action").setup({}) + { + "ckolkey/ts-node-action", + dependencies = { "nvim-treesitter", "jose-elias-alvarez/null-ls.nvim" }, + config = function() + require("ts-node-action").setup({}) - vim.keymap.set({ "n" }, "lA", require("ts-node-action").node_action, { desc = "Trigger Node Action" }) + vim.keymap.set({ "n" }, "lA", require("ts-node-action").node_action, { desc = "Node Action" }) - require("null-ls").register({ - name = "more_actions", - method = { require("null-ls").methods.CODE_ACTION }, - filetypes = { "_all" }, - generator = { - fn = require("ts-node-action").available_actions, - }, - }) - end, + require("null-ls").register({ + name = "more_actions", + method = { require("null-ls").methods.CODE_ACTION }, + filetypes = { "_all" }, + generator = { + fn = require("ts-node-action").available_actions, + }, + }) + end, + }, + { + "Wansmer/treesj", + cmd = { "TSJToggle" }, + keys = { + { "lm", "TSJToggle", desc = "Toggle treesitter join" }, + }, + dependencies = { "nvim-treesitter/nvim-treesitter" }, + opts = { + use_default_keymaps = true, + }, + }, }