From c96de953e2eae21385eeeda2cc144863ce6d9b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Sun, 5 Nov 2023 14:54:04 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(nvim):=20a=20lot?= =?UTF-8?q?=20of=20keybindings=20changed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/nvim/lazy-lock.json | 6 ++- .config/nvim/lua/plugins/cmp.lua | 2 +- .config/nvim/lua/plugins/conform.lua | 2 +- .../nvim/lua/plugins/extras/ai/codeium.lua | 2 +- .../lua/plugins/extras/coding/refactoring.lua | 2 +- .../lua/plugins/extras/editor/harpoon.lua | 2 +- .../nvim/lua/plugins/extras/lang/markdown.lua | 4 +- .config/nvim/lua/plugins/extras/lang/web.lua | 2 +- .config/nvim/lua/plugins/extras/lsp/lsp.lua | 10 ++-- .config/nvim/lua/plugins/extras/ui/alpha.lua | 4 +- .config/nvim/lua/plugins/floaterm.lua | 4 +- .config/nvim/lua/plugins/mason.lua | 4 ++ .config/nvim/lua/plugins/spectre.lua | 48 ++++++++++++++++--- .config/nvim/lua/plugins/which-key.lua | 2 + 14 files changed, 70 insertions(+), 24 deletions(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 51c9e3a7..62d1f7c5 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -41,6 +41,7 @@ "highlight-undo.nvim": { "branch": "main", "commit": "50a6884a8476be04ecce8f1c4ed692c5000ef0a1" }, "hydra.nvim": { "branch": "master", "commit": "ceb1fb7e3b4916676674e8a4253deea5a19ab01f" }, "import-cost.nvim": { "branch": "main", "commit": "39ef36f438574db0b26e9c957316eb1cb22e970f" }, + "inc-rename.nvim": { "branch": "main", "commit": "ed0f6f2b917cac4eb3259f907da0a481b27a3b7e" }, "indent-blankline.nvim": { "branch": "master", "commit": "29be0919b91fb59eca9e90690d76014233392bef" }, "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, "live-server.nvim": { "branch": "main", "commit": "f6f00a3f541251f0320910bb0d03c4ae14ee6d10" }, @@ -60,6 +61,7 @@ "mini.surround": { "branch": "main", "commit": "af8129efcabe95fc08a233e9f91569829bed031f" }, "modes.nvim": { "branch": "main", "commit": "5357fda0f4a21d73611496087a0d3b6d7b4f9384" }, "multicursors.nvim": { "branch": "main", "commit": "b4e8571b79a7d2a2aea70922c35eac3a71578c0e" }, + "muren.nvim": { "branch": "main", "commit": "818c09097dba1322b2ca099e35f7471feccfef93" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "1236db954ce502eb5b340bcdb69aa057cc372e8d" }, "neoconf.nvim": { "branch": "main", "commit": "64437787dba70fce50dad7bfbb97d184c5bc340f" }, "neodev.nvim": { "branch": "main", "commit": "80487e4f7bfa11c2ef2a1b461963db019aad6a73" }, @@ -94,7 +96,7 @@ "nvim-regexplainer": { "branch": "main", "commit": "187f8666c2ba0fcba4ddb991e48d7229b0a58d96" }, "nvim-spectre": { "branch": "master", "commit": "5c3474fbe1028844cfe5a9c238366da04c2e7551" }, "nvim-transparent": { "branch": "main", "commit": "3af6232c8d39d51062702e875ff6407c1eeb0391" }, - "nvim-treesitter": { "branch": "master", "commit": "bef2c24e23d0da62a8542b1f08b1ac87ec43e93f" }, + "nvim-treesitter": { "branch": "master", "commit": "a82bba45fb0fb43fc2e7998f3394fadc80606d8a" }, "nvim-treesitter-context": { "branch": "master", "commit": "2806d83e3965017382ce08792ee527e708fa1bd4" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "4c344ffc8d54d7e1ba2cefaaa2c10ea93aa1cc2d" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "e69a504baf2951d52e1f1fbb05145d43f236cbf1" }, @@ -129,7 +131,7 @@ "telescope-dap.nvim": { "branch": "master", "commit": "4e2d5efb92062f0b865fe59b200b5ed7793833bf" }, "telescope-floaterm.nvim": { "branch": "main", "commit": "ccd3f40ae30dce5de0e5d0f5069e08e7d9ad6d23" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, - "telescope-import.nvim": { "branch": "main", "commit": "eefc68ee5f877be9201b3fc8c2aa0cf29abee0d1" }, + "telescope-import.nvim": { "branch": "main", "commit": "b1d472b8790ec73ba71141f624dd60ab13eb571e" }, "telescope-lazy.nvim": { "branch": "main", "commit": "e75a349322db7f695bef2c50c4a85c90b064d031" }, "telescope-luasnip.nvim": { "branch": "master", "commit": "2ef7da3a363890686dbaad18ddbf59177cfe4f78" }, "telescope-undo.nvim": { "branch": "main", "commit": "3dec002ea3e7952071d26fbb5d01e2038a58a554" }, diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua index 363b30bb..c135e9df 100644 --- a/.config/nvim/lua/plugins/cmp.lua +++ b/.config/nvim/lua/plugins/cmp.lua @@ -12,7 +12,7 @@ return { }, }, keys = { - { "cM", ":CmpStatus", desc = "Cmp Status" }, + { "ciC", ":CmpStatus", desc = "Cmp Status" }, }, opts = function(_, opts) -- TODO: Fix this comments diff --git a/.config/nvim/lua/plugins/conform.lua b/.config/nvim/lua/plugins/conform.lua index 2cb0f5f7..cff2cb48 100644 --- a/.config/nvim/lua/plugins/conform.lua +++ b/.config/nvim/lua/plugins/conform.lua @@ -3,7 +3,7 @@ return { "stevearc/conform.nvim", keys = { { - "cC", + "cic", "ConformInfo", mode = { "n", "v" }, desc = "Conform Info", diff --git a/.config/nvim/lua/plugins/extras/ai/codeium.lua b/.config/nvim/lua/plugins/extras/ai/codeium.lua index 4e21978f..af18fdd2 100644 --- a/.config/nvim/lua/plugins/extras/ai/codeium.lua +++ b/.config/nvim/lua/plugins/extras/ai/codeium.lua @@ -20,7 +20,7 @@ return { return vim.fn["codeium#Clear"]() end, { expr = true }) - vim.keymap.set("n", "cI", function() + vim.keymap.set("n", "cC", function() if vim.g.codeium_enabled == true then vim.cmd("CodeiumDisable") else diff --git a/.config/nvim/lua/plugins/extras/coding/refactoring.lua b/.config/nvim/lua/plugins/extras/coding/refactoring.lua index dce60c18..071dd215 100644 --- a/.config/nvim/lua/plugins/extras/coding/refactoring.lua +++ b/.config/nvim/lua/plugins/extras/coding/refactoring.lua @@ -14,6 +14,6 @@ return { end, -- stylua: ignore keys = { - { "r", function() require('telescope').extensions.refactoring.refactors() end, mode = { "n", "x" }, desc = "Refactor" }, + { "cR", function() require('telescope').extensions.refactoring.refactors() end, mode = { "n", "x" }, desc = "Refactor" }, }, } diff --git a/.config/nvim/lua/plugins/extras/editor/harpoon.lua b/.config/nvim/lua/plugins/extras/editor/harpoon.lua index c37c431e..2279d815 100644 --- a/.config/nvim/lua/plugins/extras/editor/harpoon.lua +++ b/.config/nvim/lua/plugins/extras/editor/harpoon.lua @@ -6,7 +6,7 @@ return { --stylua: ignore keys = { { "'", function() require("harpoon.mark").add_file() end, desc = "Add File" }, - { "0", "Telescope harpoon marks", desc = "Harpoon" }, + { ";", "Telescope harpoon marks", desc = "Harpoon" }, { "1", function() require("harpoon.ui").nav_file(1) end, desc = "File 1" }, { "2", function() require("harpoon.ui").nav_file(2) end, desc = "File 2" }, { "3", function() require("harpoon.ui").nav_file(3) end, desc = "File 3" }, diff --git a/.config/nvim/lua/plugins/extras/lang/markdown.lua b/.config/nvim/lua/plugins/extras/lang/markdown.lua index e4dcbd52..e2f5ae3f 100644 --- a/.config/nvim/lua/plugins/extras/lang/markdown.lua +++ b/.config/nvim/lua/plugins/extras/lang/markdown.lua @@ -27,8 +27,8 @@ return { { "", "AutolistToggleCheckbox", mode = { "n" } }, { "", "AutolistRecalculate", mode = { "n" } }, - { "].", "AutolistCycleNext", mode = { "n" }, { desc = "Next List Type" } }, - { "[.", "AutolistCyclePrev", mode = { "n" }, { desc = "Prev List Type" } }, + { "].", "AutolistCycleNext", mode = { "n" }, desc = "Next List Type" }, + { "[.", "AutolistCyclePrev", mode = { "n" }, desc = "Prev List Type" }, { ">>", ">>AutolistRecalculate", mode = { "n" } }, { "<<", "<<AutolistRecalculate", mode = { "n" } }, diff --git a/.config/nvim/lua/plugins/extras/lang/web.lua b/.config/nvim/lua/plugins/extras/lang/web.lua index 1790bdfb..bf9c0b20 100644 --- a/.config/nvim/lua/plugins/extras/lang/web.lua +++ b/.config/nvim/lua/plugins/extras/lang/web.lua @@ -6,7 +6,7 @@ return { end, cmd = { "LiveServer", "LiveServerStart", "LiveServerStop" }, keys = { - { "cL", "LiveServer", desc = "LiveServer" }, + { "cl", "LiveServer", desc = "LiveServer" }, }, }, { diff --git a/.config/nvim/lua/plugins/extras/lsp/lsp.lua b/.config/nvim/lua/plugins/extras/lsp/lsp.lua index a046e906..0aed75e3 100644 --- a/.config/nvim/lua/plugins/extras/lsp/lsp.lua +++ b/.config/nvim/lua/plugins/extras/lsp/lsp.lua @@ -29,7 +29,7 @@ return { keys[#keys + 1] = { "ca", require("actions-preview").code_actions, desc = "Code Action Preview" } keys[#keys + 1] = { "cl", false } - keys[#keys + 1] = { "cli", "LspInfo", desc = "LspInfo" } + keys[#keys + 1] = { "cil", "LspInfo", desc = "Lsp" } keys[#keys + 1] = { "uv", toggle_diag_virtext, desc = "Toggle Diagnostic VirtualText" } keys[#keys + 1] = { @@ -43,9 +43,6 @@ return { keys[#keys + 1] = { "clr", "LspRestart", desc = "Restart Lsp" } keys[#keys + 1] = { "cls", "LspStart", desc = "Start Lsp" } keys[#keys + 1] = { "clS", "LspStop", desc = "Stop Lsp" } - require("which-key").register({ - ["cl"] = { name = "+lsp" }, - }) require("lazyvim.util").lsp.on_attach(function(client, buffer) if client.supports_method("textDocument/documentSymbol") then -- Enable inlay hints if the client supports it. @@ -173,6 +170,11 @@ return { }, }, }, + { + "smjonas/inc-rename.nvim", + cmd = "IncRename", + opts = {}, + }, { "dnlhc/glance.nvim", cmd = { "Glance" }, diff --git a/.config/nvim/lua/plugins/extras/ui/alpha.lua b/.config/nvim/lua/plugins/extras/ui/alpha.lua index 1262e28e..e9df1b44 100644 --- a/.config/nvim/lua/plugins/extras/ui/alpha.lua +++ b/.config/nvim/lua/plugins/extras/ui/alpha.lua @@ -1,7 +1,9 @@ return { "goolord/alpha-nvim", event = "VimEnter", - optional = true, + keys = { + { "fa", "Alpha", desc = "Dashboard (Alpha)" }, + }, opts = function() local dashboard = require("alpha.themes.dashboard") local logo = [[ diff --git a/.config/nvim/lua/plugins/floaterm.lua b/.config/nvim/lua/plugins/floaterm.lua index b01c6f0c..c7fee5ba 100644 --- a/.config/nvim/lua/plugins/floaterm.lua +++ b/.config/nvim/lua/plugins/floaterm.lua @@ -16,7 +16,7 @@ return { { "Tp", "FloatermNew --disposable --name=proc --opener=edit --titleposition=center --height=0.85 --width=0.85 proc", desc = "Systemd Processes" }, { "TB", "FloatermNew --disposable --name=bandwhich --opener=edit --titleposition=center --height=0.85 --width=0.85 bandwhich", desc = "Bandwidth" }, { "gF", "FloatermNew --disposable --name=forgit --opener=edit --titleposition=center --height=0.85 --width=0.85 fgit", desc = "Forgit" }, - { "ci", "FloatermNew! --disposable --name=scc --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= codeinfo", desc = "Code info/fetch" }, + { "cif", "FloatermNew! --disposable --name=scc --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= codeinfo", desc = "Code info/fetch" }, { "gf", "FloatermNew! --disposable --name=onefetch --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= gfetch", desc = "Gitfetch" }, { "cen", "FloatermNew --name=node --opener=edit --titleposition=center --wintype=split --height=0.35 node", desc = "Node" }, { "cep", "FloatermNew --name=python --opener=edit --titleposition=center --wintype=split --height=0.35 python", desc = "Python" }, @@ -38,7 +38,7 @@ return { "folke/which-key.nvim", opts = { defaults = { - ["ce"] = { name = "+r[E]pl" }, + ["ce"] = { name = "+r[e]pl" }, ["ft"] = { name = "+terminals" }, ["T"] = { name = "+tools" }, }, diff --git a/.config/nvim/lua/plugins/mason.lua b/.config/nvim/lua/plugins/mason.lua index 88aca6cf..f09bea12 100644 --- a/.config/nvim/lua/plugins/mason.lua +++ b/.config/nvim/lua/plugins/mason.lua @@ -1,6 +1,10 @@ return { { "williamboman/mason.nvim", + keys = { + { "cm", false }, + { "cim", "Mason", desc = "Mason" }, + }, opts = { ensure_installed = { "black", diff --git a/.config/nvim/lua/plugins/spectre.lua b/.config/nvim/lua/plugins/spectre.lua index b360432d..47f7fa4b 100644 --- a/.config/nvim/lua/plugins/spectre.lua +++ b/.config/nvim/lua/plugins/spectre.lua @@ -3,13 +3,47 @@ return { "nvim-pack/nvim-spectre", cmd = "Spectre", opts = {}, - -- stylua: ignore - keys = { - { "srf", function() require("spectre").toggle() end, desc = "Replace globally" }, - { "srw", mode = {"n"},function() require("spectre").open_visual({select_word=true}) end, desc = "Current Word" }, - { "srw", mode = {"v"},function() require("spectre").open_visual() end, desc = "Current Word" }, - { "src", mode = {"n"},function() require("spectre").open_file_search({select_word=true}) end, desc = "Word on Current File" }, - }, + keys = { + { + "srf", + function() + require("spectre").toggle() + end, + desc = "Search globally", + }, + { + "srw", + mode = { "n" }, + function() + require("spectre").open_visual({ select_word = true }) + end, + desc = "Current Word", + }, + { + "srw", + mode = { "v" }, + function() + require("spectre").open_visual() + end, + desc = "Current Word", + }, + { + "srW", + mode = { "n" }, + function() + require("spectre").open_file_search({ select_word = true }) + end, + desc = "Word on Current File", + }, + { + "src", + mode = { "n" }, + function() + require("spectre").open_file_search({}) + end, + desc = "Current File", + }, + }, }, { "folke/which-key.nvim", diff --git a/.config/nvim/lua/plugins/which-key.lua b/.config/nvim/lua/plugins/which-key.lua index 2b195f1b..69813ae8 100644 --- a/.config/nvim/lua/plugins/which-key.lua +++ b/.config/nvim/lua/plugins/which-key.lua @@ -5,6 +5,8 @@ return { opts = { defaults = { ["dP"] = { name = "+python" }, + ["cL"] = { name = "+lsp" }, + ["ci"] = { name = "+info" }, }, }, },