flash.nvim
flash.nvim copied to clipboard
feature: casing options for each mode
Did you check the docs?
- [X] I have read all the flash.nvim docs
Is your feature request related to a problem? Please describe.
In standard vim, ignorecase/smartcase does not apply to f
behaviour, I.E: nvim -u NONE
:
Searching with /
for qui
with ignorecase+smartcase hits the first result:
Searching with f
for q
with ignorecase+smartcase hits the second result:
It's intuitive that flash respects these settings for /
, but for f
this was a surprise compared to vanilla behaviour and breaks the utility of plugins like quickscope which now highlight the wrong symbols, so in my example here while my eyes are trained on q
, pressing q
actually takes me to Q
.
So I repeatedly find myself often accidentally jumping earlier than I expected.
Describe the solution you'd like
To be able to disable case settings on a mode by mode basis:
config = {
modes = {
char = {
case = 'sensitive'
}
}
}
Where a default of inherit
might imply the current behaviour, I don't have a good idea in mind for how this option might exactly look though this is just a quick scrappy explanation of what I would like to be able to do.
Alternatively, to change f
to not rely on ignorecase/smartcase so it matches vanilla nvim behaviour:
'smartcase' 'scs' boolean (default off)
global
Override the 'ignorecase' option if the search pattern contains upper
case characters. Only used when the search pattern is typed and
'ignorecase' option is on. Used for the commands "/", "?", "n", "N",
":g" and ":s". Not used for "*", "#", "gd", tag search, etc. After
"*" and "#" you can make 'smartcase' used by doing a "/" command,
recalling the search pattern from history and hitting <Enter>.
Describe alternatives you've considered
- Disable flash for
f
and stick to onlys
and/
benefits of flash. - Disable uppercase searches for quickscope as most of the time I'm searching lowercase, but this isn't ideal as quickscope requires listing every possible matchable char if you try and override the allowable characters so you have to maintain a whitelist. This would reduce the amount of matchable positions as well which is unfortunate.
Additional context
While It's not related to the feature I'm requesting here, I was wondering what your thoughts might be on adding quickscopes functionality to flash? Quickscope is a pretty old plugin at this point as far as I can tell, and flash's f
behaviour is very nice. Having the ability to show the first non-conflicting f
jump in each word, but being able to do it over multiple lines would be incredibly useful.
Based on this comment, an alternative approach would be to override the jump behavior as follows:
function()
local ignorecase = vim.go.ignorecase
vim.go.ignorecase = false
require('flash').something({ I'm not sure what to put here })
vim.go.ignorecase = ignorecase
end
However, I don't know where this would go in the flash config, as I do not see an option for supplying a custom function for the f/F/t/T feature.
Any tips on how to use this approach would be much appreciated since I am a bit confused about how to set this up.
@Reisen did you ever find another workaround?
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.
This has not been addressed, so the stale label should be removed.
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.
Still not stale.
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.
Nope
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.
the default behavior doesnt match native nvim so in cases is not expected. would be lovely to have that option in flash natively