From 88751ef114640014c4890b822ad8c4f08102806d Mon Sep 17 00:00:00 2001
From: "iliya.saroukha" <iliya.saroukhanian@etu.hesge.ch>
Date: Sun, 28 Jul 2024 23:47:42 +0200
Subject: [PATCH] feat: added grug-far.nvim for search and replace

---
 lua/plugins/grug-far.lua | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 lua/plugins/grug-far.lua

diff --git a/lua/plugins/grug-far.lua b/lua/plugins/grug-far.lua
new file mode 100644
index 0000000..339bc7c
--- /dev/null
+++ b/lua/plugins/grug-far.lua
@@ -0,0 +1,22 @@
+return {
+    "MagicDuck/grug-far.nvim",
+    opts = { headerMaxWidth = 80 },
+    cmd = "GrugFar",
+    keys = {
+        {
+            "<leader>sr",
+            function()
+                local grug = require("grug-far")
+                local ext = vim.bo.buftype == "" and vim.fn.expand("%:e")
+                grug.grug_far({
+                    transient = true,
+                    prefills = {
+                        filesFilter = ext and ext ~= "" and "*." .. ext or nil,
+                    },
+                })
+            end,
+            mode = { "n", "v" },
+            desc = "Search and Replace",
+        },
+    },
+}
-- 
GitLab