flash.nvim
flash.nvim copied to clipboard
feature: Is any way to use '/' but don't use '?'
Did you check the docs?
- [X] I have read all the flash.nvim docs
Is your feature request related to a problem? Please describe.
I want to use '/' to flash any where with flash.nvim, but keep '?' to search any word in old way. I test bind '/' to flash.jump(), but sometimes i want to '/' to search word like old way, i call flash.toggle() is not work. cause flash.toggle() control the search not flash.jump().
Describe the solution you'd like
I think diff the '/' and '?' in config, make flash search use '/' or '?' is good way?
Describe alternatives you've considered
nope
Additional context
No response
If I understand right:
-
/
should do flash jump (not search) -
?
should do a normal backwards search, as vim does without this plugin?
Then you can achieve that with config like
{
"folke/flash.nvim",
keys = {
{ "/", mode = { "n", "x", "v" }, function() require("flash").jump(); end, desc = "Flash Jump" },
{ "?", mode = { "n", "x", "v" }, function() require("flash").toggle(false); vim.api.nvim_feedkeys('?', 'n', true) end, desc = "Normal backward search" },
}
}
If you wanted ?
to do what nvim does normally on /
(forward search) just change the feedkeys bit.
**artfulrobot ** commented Feb 20, 2024 •
But i notice in your mapping, here always call require("flash").toggle(false), this will change the flash setting, is that OK?
@Mr-LLLLL well it's fine by me because /
will do the flash jump type search always anyway. Basically, I only want flash search for /
and any other search should be normal search.
hope can help you
/
for old way
vim.keymap.set('n', '/', function()
require("flash").toggle(false)
vim.fn.feedkeys("/", "n")
end)
vim.api.nvim_create_autocmd("CmdlineLeave", {
pattern = "*",
callback = function()
require("flash").toggle(true)
end,
})
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.