Skip to content

Commit

Permalink
fix(keymap): reset "/" and "?" to regular search instead of flash.nvim
Browse files Browse the repository at this point in the history
Because the flash search mode binding to "/" and "?" may cause accidental touch for most vim users.

So I decide to reset it to original. And Use "f/" to enter the flash search mode.
  • Loading branch information
adoyle-h committed Sep 30, 2023
1 parent 1c14ee1 commit 78e2768
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/usage/keymaps.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ Press `<space>k` to see all keymaps in nvim.
- `fL` = Jump to line (include whitespace)
- `fa` = Jump to word matches beginning of input
- `fA` = Jump to word matches ending of input
- `f/` = Jump to word as you type
- `g[` = Jump to previous cursor position
- `g]` = Jump to next cursor position
- `<C-]>` = Jump to the definition of the keyword under the cursor. see `:h CTRL-]`
Expand Down
12 changes: 10 additions & 2 deletions lua/one/plugins/move/flash.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ M.highlights = function(config)
local c = config.colors
return {
FlashCurrent = { link = 'Search' },
FlashMatch = { fg = c.green, bg = c.black, bold = true },
FlashMatch = { fg = c.orange, bg = c.black },
FlashBackdrop = { fg = c.grey, bg = c.black },
FlashLabel = { fg = c.black, bg = c.orange, bold = true, italic = true },
FlashChar1 = { fg = c.orange, bg = c.black, bold = true },
Expand Down Expand Up @@ -175,7 +175,7 @@ M.defaultConfig = {
search = {
-- when `true`, flash will be activated during regular search by default.
-- You can always toggle when searching with `require("flash").toggle()`
enabled = true,
enabled = false,
jump = { history = true, register = true, nohlsearch = true },
search = {
-- `forward` will be automatically set to the search direction
Expand Down Expand Up @@ -390,6 +390,14 @@ M.keymaps = {
{ desc = 'Jump to word matches ending of input' },
},

{
'',
'f/',
function()
require('flash').jump();
end,
{ desc = 'Jump to word as you type' },
},
}

M.commands = {
Expand Down

0 comments on commit 78e2768

Please sign in to comment.