From 332c6aa6d698a00188e2241fac2888ef46f58b8b Mon Sep 17 00:00:00 2001 From: "Mariano Z." Date: Sun, 12 Oct 2025 17:49:26 -0300 Subject: [PATCH] dev: automated commit - 2025-10-12 17:49:26 --- lazy-lock.json | 8 ++--- lua/config/remap.lua | 3 ++ lua/plugins/grug-far.lua | 73 ++++++++++++++++++++++++++++++++++++++++ lua/plugins/spectre.lua | 22 ------------ 4 files changed, 80 insertions(+), 26 deletions(-) create mode 100644 lua/plugins/grug-far.lua delete mode 100644 lua/plugins/spectre.lua diff --git a/lazy-lock.json b/lazy-lock.json index 50adb66..e0ab690 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -12,6 +12,7 @@ "gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" }, "gitsigns.nvim": { "branch": "main", "commit": "1ee5c1fd068c81f9dd06483e639c2aa4587dc197" }, "go.nvim": { "branch": "master", "commit": "db20146ef63322949af69b0955f80ee7d98145bd" }, + "grug-far.nvim": { "branch": "main", "commit": "2e991081c0e653e151fc9e659514d7c2fc31d22a" }, "lazy.nvim": { "branch": "main", "commit": "1ea3c4085785f460fb0e46d2fe1ee895f5f9e7c1" }, "lazydev.nvim": { "branch": "main", "commit": "e28ce52fc7ff79fcb76f0e79ee6fb6182fca90b9" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, @@ -25,8 +26,7 @@ "nvim-dbee": { "branch": "master", "commit": "dda517694889a5d238d7aa407403984da9f80cc0" }, "nvim-lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" }, "nvim-lint": { "branch": "master", "commit": "9da1fb942dd0668d5182f9c8dee801b9c190e2bb" }, - "nvim-lspconfig": { "branch": "master", "commit": "cc2f5f2fa28d240574808e78847978ed6ef20d2a" }, - "nvim-spectre": { "branch": "master", "commit": "72f56f7585903cd7bf92c665351aa585e150af0f" }, + "nvim-lspconfig": { "branch": "master", "commit": "ac98db2f9f06a56498ec890a96928774eae412c3" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, "nvim-ufo": { "branch": "main", "commit": "72d54c31079d38d8dfc5456131b1d0fb5c0264b0" }, @@ -37,8 +37,8 @@ "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, "quicker.nvim": { "branch": "master", "commit": "12a2291869a326424b1cbee937f4f80334433012" }, "render-markdown.nvim": { "branch": "main", "commit": "d53856423be5ef3c267d26ee261b0981b372f718" }, - "schemastore.nvim": { "branch": "main", "commit": "0a900e539511a4461701f241278626ce6ec8d331" }, - "snacks.nvim": { "branch": "main", "commit": "dae80fb393f712bd7352a20f9185f5e16b69f20f" }, + "schemastore.nvim": { "branch": "main", "commit": "155d57353fbf0f9b0b8b7cdd7f8a7ee44bb7cd69" }, + "snacks.nvim": { "branch": "main", "commit": "b8d838d8be274c8eecced4306cca15378cde9830" }, "suda.vim": { "branch": "master", "commit": "9adda7d195222d4e2854efb2a88005a120296c47" }, "todo-comments.nvim": { "branch": "main", "commit": "19d461ddd543e938eb22505fb03fa878800270b6" }, "typst-preview.nvim": { "branch": "master", "commit": "dea4525d5420b7c32eebda7de15a6beb9d6574fa" }, diff --git a/lua/config/remap.lua b/lua/config/remap.lua index a0f8091..816d679 100644 --- a/lua/config/remap.lua +++ b/lua/config/remap.lua @@ -88,5 +88,8 @@ nmap("qk", "cprev", { desc = "Previous quickfix item" }) nmap("", "nohlsearch", { desc = "Clear search highlights" }) +-- Restore 's' key functionality (Mini.surround overrides it by default) +nmap("s", "cl", { desc = "Delete character and enter insert mode" }) + -- Launch lazygit in a new tmux pane, exits when done nmap("lg", "!tmux new-window -c " .. vim.fn.getcwd() .. " -- lazygit ", { desc = "LazyGit" }) diff --git a/lua/plugins/grug-far.lua b/lua/plugins/grug-far.lua new file mode 100644 index 0000000..ae01bbd --- /dev/null +++ b/lua/plugins/grug-far.lua @@ -0,0 +1,73 @@ +local M = { + "MagicDuck/grug-far.nvim", + cmd = "GrugFar", + keys = { + { "S", "GrugFar", desc = "GrugFar: Find and Replace" }, + }, +} + +M.config = function() + require("grug-far").setup({ + -- Basic configuration + minSearchLength = 2, + debounceMs = 300, + + -- UI configuration + ui = { + border = "rounded", + size = { + width = 0.8, + height = 0.8, + }, + }, + + -- Search configuration + search = { + engines = { "ripgrep", "astgrep", "astgrep-rules" }, + defaultEngine = "ripgrep", + }, + + -- History configuration - simplified to avoid the autoSave bug + history = { + enabled = true, + maxEntries = 50, + }, + + -- Result configuration + resultLocation = { + showNumberLabel = true, + }, + }) + + -- Additional keybindings for enhanced functionality + vim.api.nvim_create_autocmd("FileType", { + group = vim.api.nvim_create_augroup("grug-far-custom-keybinds", { clear = true }), + pattern = { "grug-far" }, + callback = function() + -- Toggle --fixed-strings flag + vim.keymap.set("n", "w", function() + local state = unpack(require("grug-far").get_instance(0):toggle_flags({ "--fixed-strings" })) + vim.notify("grug-far: toggled --fixed-strings " .. (state and "ON" or "OFF")) + end, { buffer = true, desc = "Toggle fixed strings" }) + + -- Open result location and close grug-far + vim.keymap.set("n", "", function() + require("grug-far").get_instance(0):open_location() + require("grug-far").get_instance(0):close() + end, { buffer = true, desc = "Open location and close" }) + + -- Jump back to first input + vim.keymap.set("n", "", function() + require("grug-far").get_instance(0):goto_first_input() + end, { buffer = true, desc = "Jump to first input" }) + + -- Toggle multiline mode + vim.keymap.set("n", "m", function() + local state = unpack(require("grug-far").get_instance(0):toggle_flags({ "--multiline" })) + vim.notify("grug-far: toggled --multiline " .. (state and "ON" or "OFF")) + end, { buffer = true, desc = "Toggle multiline mode" }) + end, + }) +end + +return M diff --git a/lua/plugins/spectre.lua b/lua/plugins/spectre.lua deleted file mode 100644 index 37eca14..0000000 --- a/lua/plugins/spectre.lua +++ /dev/null @@ -1,22 +0,0 @@ -local M = { - "nvim-pack/nvim-spectre", -} - -M.config = function() - require("spectre").setup() - - nmap("S", 'lua require("spectre").toggle()', { - desc = "Toggle Spectre", - }) - nmap("sw", 'lua require("spectre").open_visual({select_word=true})', { - desc = "[Spectre] Search current word", - }) - nmap("sw", 'lua require("spectre").open_visual()', { - desc = "[Spectre] Search current word", - }) - nmap("sp", 'lua require("spectre").open_file_search({select_word=true})', { - desc = "[Spectre] Search on current file", - }) -end - -return M