From 90a3afac3883ba64407a300cebee91079dea509c Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 18 Jul 2024 11:09:30 +0200 Subject: [PATCH] feat(editor): replace nvim-spectre with grug-far.nvim --- lua/lazyvim/plugins/editor.lua | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index f893b355..72b76568 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -128,13 +128,22 @@ return { -- search/replace in multiple files { - "nvim-pack/nvim-spectre", - build = false, - cmd = "Spectre", - opts = { open_cmd = "noswapfile vnew" }, - -- stylua: ignore + "MagicDuck/grug-far.nvim", + opts = { headerMaxWidth = 80 }, + cmd = "GrugFar", keys = { - { "sr", function() require("spectre").open() end, desc = "Replace in Files (Spectre)" }, + { + "sr", + function() + require("grug-far").grug_far({ + prefills = { + search = vim.fn.expand(""), + filesFilter = "*." .. vim.fn.expand("%:e"), + }, + }) + end, + desc = "Search and Replace", + }, }, },