nvim/lua/plugins/spectre.lua

28 lines
869 B
Lua
Raw Normal View History

2023-06-06 15:51:03 +01:00
return {
"nvim-pack/nvim-spectre",
cmd = "Spectre",
dependencies = { "nvim-lua/plenary.nvim" },
init = function()
vim.keymap.set("n", "<leader>so", '<cmd>lua require("spectre").open()<CR>', { desc = "Open Spectre" })
2023-06-06 15:51:03 +01:00
vim.keymap.set(
"n",
"<leader>sw",
'<cmd>lua require("spectre").open_visual({select_word=true})<CR>',
{ desc = "Search current word" }
)
vim.keymap.set(
"v",
"<leader>sw",
'<esc><cmd>lua require("spectre").open_visual()<CR>',
{ desc = "Search current word" }
)
vim.keymap.set(
"n",
"<leader>sp",
'<cmd>lua require("spectre").open_file_search({select_word=true})<CR>',
{ desc = "Search on current file" }
)
end,
config = true,
}