Skip to content

Commit

Permalink
improv: keymap hints
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Aug 17, 2024
1 parent 7757779 commit 5a80349
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ require("rip-substitute").setup {
insertModeConfirm = "<C-CR>",
prevSubst = "<Up>",
nextSubst = "<Down>",
openAtRegex101 = "R",
toggleFixedStrings = "<C-f>",
openAtRegex101 = "R",
},
incrementalPreview = {
matchHlGroup = "IncSearch",
Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion lua/rip-substitute/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ local defaultConfig = {
insertModeConfirm = "<C-CR>",
prevSubst = "<Up>",
nextSubst = "<Down>",
openAtRegex101 = "R",
toggleFixedStrings = "<C-f>",
openAtRegex101 = "R",
},
incrementalPreview = {
matchHlGroup = "IncSearch",
Expand Down
4 changes: 2 additions & 2 deletions lua/rip-substitute/popup-win.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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>", "")
Expand Down

0 comments on commit 5a80349

Please sign in to comment.