-
Notifications
You must be signed in to change notification settings - Fork 192
Description
Reedline's vi mode supports the t/T/f/F single-character search commands, but has limited support for the //? multi-character search commands. Specifically:
/is not implemented at all.?only searches the command history. It does not search the current line.?cannot be used as a motion.
Having ? search the history does match zsh's Vi mode. But it doesn't match actual Vi.
In Vi, multi-character searches do differ from single-character searches in that single-character searches only search the current line, whereas multi-character searches search the whole file.
But otherwise they work similarly. Both types of searches start at the cursor. Both are capable of finding matches on the current line. Both can be used as motions.
Personally, I'm trying to move to nushell from zsh, and in zsh I use a plugin that makes / and ? work like real Vi, albeit only searching the current command, not command history as well. To search command history I use Ctrl-R, which I have bound to work in Vi mode like it does in standard mode (something which, incidentally, reedline does by default, at the cost of not supporting Vim's redo command).
That's just my quixotic setup, so maybe it doesn't belong in reedline. I need to investigate whether it's possible to implement this for myself using custom keybindings, or if not, what changes would be required to make that possible. (I've seen #875 which also generally proposes to improve custom vi keybinding support.)
However, I think there's a plausible argument for adding within-line / and ? as an (optional) built-in reedline feature, since it would make the Vi mode act more like Vi.