From 1c4cc5ef7842e8b39f5838a802bce9d004118bcc Mon Sep 17 00:00:00 2001 From: kokopi-dev Date: Tue, 14 Apr 2026 03:38:45 +0900 Subject: [PATCH] update:grug settings --- nvim/lua/plugins/tools.lua | 8 +++++--- nvim/lua/settings/options.lua | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nvim/lua/plugins/tools.lua b/nvim/lua/plugins/tools.lua index 798e913..6c0f228 100644 --- a/nvim/lua/plugins/tools.lua +++ b/nvim/lua/plugins/tools.lua @@ -10,6 +10,8 @@ local function with_trouble(fn) fn() end +-- grug guide +-- navigate splits: or local function with_grug(fn) lazy.load_once("grug-far", pack.registry({ "grug-far.nvim" }), function() require("grug-far").setup({}) @@ -48,9 +50,9 @@ function M.setup() end) end, { desc = "Search/replace current file" }) - vim.keymap.set("v", "s", function() - with_grug(function() - vim.cmd("'<,'>GrugFarWithin") + vim.keymap.set("x", "s", function() + with_grug(function(grug) + grug.open({ visualSelectionUsage = "operate-within-range" }) end) end, { desc = "Search/replace in selection" }) end diff --git a/nvim/lua/settings/options.lua b/nvim/lua/settings/options.lua index 518605a..4d4e52f 100644 --- a/nvim/lua/settings/options.lua +++ b/nvim/lua/settings/options.lua @@ -1,4 +1,5 @@ vim.g.mapleader = " " +vim.g.maplocalleader = " " vim.opt.timeoutlen = 350 vim.opt.updatetime = 50