From 5a80349aa8ab973954245d25d89de2532f9566eb Mon Sep 17 00:00:00 2001 From: Chris Grieser <73286100+chrisgrieser@users.noreply.github.com> Date: Sat, 17 Aug 2024 10:53:48 +0200 Subject: [PATCH] improv: keymap hints --- README.md | 6 +++--- lua/rip-substitute/config.lua | 2 +- lua/rip-substitute/popup-win.lua | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c545e96..be3ffc8 100644 --- a/README.md +++ b/README.md @@ -113,8 +113,8 @@ require("rip-substitute").setup { insertModeConfirm = "", prevSubst = "", nextSubst = "", - openAtRegex101 = "R", toggleFixedStrings = "", + openAtRegex101 = "R", }, incrementalPreview = { matchHlGroup = "IncSearch", @@ -189,9 +189,9 @@ case the prefill is not escaped. **Remember prefill** The function `require("rip-substitute").rememberCursorWord()` can be used to save the word under the cursor for the next time `rip-substitute` is called. -(This will override any other prefill for that run.) +(This overrides any other prefill for that run.) -One use case for this is to set a prefill for when you intend to run substitute +One use case for this is to set a prefill for when you intend to run substitute with a range, since calling `rip-substitute` in visual line is not able to pick up a prefill. diff --git a/lua/rip-substitute/config.lua b/lua/rip-substitute/config.lua index 47ab16f..01b6236 100644 --- a/lua/rip-substitute/config.lua +++ b/lua/rip-substitute/config.lua @@ -22,8 +22,8 @@ local defaultConfig = { insertModeConfirm = "", prevSubst = "", nextSubst = "", - openAtRegex101 = "R", toggleFixedStrings = "", + openAtRegex101 = "R", }, incrementalPreview = { matchHlGroup = "IncSearch", diff --git a/lua/rip-substitute/popup-win.lua b/lua/rip-substitute/popup-win.lua index e4c0c8c..722e505 100644 --- a/lua/rip-substitute/popup-win.lua +++ b/lua/rip-substitute/popup-win.lua @@ -302,8 +302,8 @@ function M.openSubstitutionPopup() -- 2. shorten them as much as possible, to keep the popup width small local m = config.keymaps local keymapHint = #state.popupHistory == 0 - and ("%s Confirm %s Abort"):format(m.confirm, m.abort) - or ("%s/%s Prev/Next %s regex101"):format(m.prevSubst, m.nextSubst, m.openAtRegex101) + and ("%s confirm %s abort"):format(m.confirm, m.abort) + or ("%s/%s history %s literal"):format(m.prevSubst, m.nextSubst, m.toggleFixedStrings) keymapHint = keymapHint -- using only utf symbols, so they work w/o nerd fonts :gsub("<[Cc][Rr]>", "↩") :gsub("<[dD]own>", "↓")