Skip to content

Commit

Permalink
neovim: replace nvim-spectre with grug-far
Browse files Browse the repository at this point in the history
  • Loading branch information
geodimm committed Oct 22, 2024
1 parent 27941f2 commit d3da08e
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions nvim/lua/plugins/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,7 @@ return {
end,
},
{
'windwp/nvim-spectre',
dependencies = {
'nvim-lua/popup.nvim',
'nvim-lua/plenary.nvim',
},
'MagicDuck/grug-far.nvim',
init = function()
local keymap = require('utils.keymap')
keymap.register_group('<leader>s', 'Search', {})
Expand All @@ -200,42 +196,43 @@ return {
{
'<leader>sr',
function()
require('spectre').open()
require('grug-far').open()
end,
desc = 'Search in project',
},
{
'<leader>sw',
function()
require('spectre').open_visual({ select_word = true })
require('grug-far').open({ prefills = { search = vim.fn.expand('<cword>') } })
end,
desc = 'Search for word under cursor',
},
{
'<leader>sw',
function()
require('spectre').open_visual()
require('grug-far').with_visual_selection()
end,
desc = 'Search for selection',
mode = { 'v', 'x' },
},
{
'<leader>sf',
function()
require('spectre').open_file_search()
require('grug-far').open({ prefills = { paths = vim.fn.expand('%') } })
end,
desc = 'Search in current file',
},
},
opts = {
mapping = {
['send_to_qf'] = {
map = '<M-q>',
cmd = "<cmd>lua require('spectre.actions').send_to_qf()<CR>",
desc = 'send all item to quickfix',
},
{
'<leader>sa',
function()
require('grug-far').open({ engine = 'astgrep' })
end,
desc = 'Search with ast-grep engine',
},
},
config = function(_, opts)
require('grug-far').setup(opts)
end,
},
{
'echasnovski/mini.indentscope',
Expand Down

0 comments on commit d3da08e

Please sign in to comment.