Skip to content

Commit

Permalink
chore(keymap.editor): replace nvim-spectre with grug-far.nvim.
Browse files Browse the repository at this point in the history
  • Loading branch information
ayamir committed Feb 5, 2025
1 parent 2d9be45 commit 9563010
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lua/keymap/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,27 +102,27 @@ local mappings = {
["nv|<leader>c"] = map_cmd("<Cmd>HopChar1MW<CR>"):with_noremap():with_desc("jump: Goto one char"),
["nv|<leader>C"] = map_cmd("<Cmd>HopChar2MW<CR>"):with_noremap():with_desc("jump: Goto two chars"),

-- Plugin: nvim-spectre
-- Plugin: grug-far
["n|<leader>Ss"] = map_callback(function()
require("spectre").toggle()
require("grug-far").open()
end)
:with_silent()
:with_noremap()
:with_desc("editn: Toggle search & replace panel"),
["n|<leader>Sp"] = map_callback(function()
require("spectre").open_visual({ select_word = true })
require("grug-far").open({ prefills = { search = vim.fn.expand("<cword>") } })
end)
:with_silent()
:with_noremap()
:with_desc("editn: search&replace current word (project)"),
["v|<leader>Sp"] = map_callback(function()
require("spectre").open_visual()
require("grug-far").with_visual_selection()
end)
:with_silent()
:with_noremap()
:with_desc("edit: search & replace current word (project)"),
["n|<leader>Sf"] = map_callback(function()
require("spectre").open_file_search({ select_word = true })
require("grug-far").open({ prefills = { paths = vim.fn.expand("%") } })
end)
:with_silent()
:with_noremap()
Expand Down

0 comments on commit 9563010

Please sign in to comment.