Perhaps the ~ / .inputrc file matched these keys with something strange? Or you donβt quite understand how search history works.
Let it start fresh: Remove these keys with bindkey:
bindkey -M vicmd "?" history-incremental-search-backward bindkey -M vicmd "/" history-incremental-search-forward
Now when you press 'esc' (for normal vi mode) and '?' you will get bck-i-search command:
% user@hostname : vim /etx/apache2/sites-enabled/defaul[t] bck-i-search:
At this point, enter a search type, for example. 'Ext. And the cursor moves to this position on this line. Note: if he does not find this template in this current line, he continues to search for your story. This behavior is considered a feature!
You may notice that you cannot search multiple times (for example, press "N" in vim). In this case, add some search bindings:
bindkey -M isearch '^N' history-incremental-search-backward bindkey -M isearch '^R' history-incremental-search-forward
Now pressing the -N button repeats your search, and pressing the control-S button changes the direction of the repeated search (note: the default order for this binding is canceled from the beginning to the opposite, since most often it looks back from the end of the story).
In short: treat the current line as the βtopβ of your story. Using vicmd '/' or '?' looking for the whole story. "?" searches from top to bottom, while '/' searches where the cursor is in your story at the top. Another way to think about it is to present your story as one large file, and the current line is at the bottom of the file. If this helps you figure it out, can you feel it? more appropriate than "/".
source share