From 78ec2f1a66f74ba5807da701e098ff32d1db79d3 Mon Sep 17 00:00:00 2001 From: utensil Date: Mon, 21 Oct 2024 18:12:10 +0800 Subject: [PATCH] Add basic key mapping for spectre --- config.lua | 8 ++++++++ trees/uts-002F.tree | 2 ++ 2 files changed, 10 insertions(+) diff --git a/config.lua b/config.lua index 435a3b3..c1e2195 100644 --- a/config.lua +++ b/config.lua @@ -296,6 +296,14 @@ lvim.plugins = { }, } end, + keys = { + { "ss", "lua require('spectre').toggle()", desc = "Toggle Spectre" }, + { + "sw", + "lua require('spectre').open_visual({select_word=true})", + desc = "Spectre (word)", + }, + }, }, { "neovim/nvim-lspconfig", diff --git a/trees/uts-002F.tree b/trees/uts-002F.tree index f14afcb..5d93c0a 100644 --- a/trees/uts-002F.tree +++ b/trees/uts-002F.tree @@ -85,6 +85,8 @@ Here are some useful keys that I like using in NeoVim, with [my LunarVim configu - remember to press `Enter` after typing the search term - use `+h` to clear the search highlight - use `s/before/after/g` to replace all occurrences, remember `%`, otherwise it will only look for the pattern in the current line + - use `:lua require("spectre").toggle()` to toggle the search and replace panel + - `+R` to replace all occurrences - edits in normal mode (status quo in VSCode Vim mode) - select and - ✅ delete by `d`/`x`