I'm a new user to Fish. I use vi command line bindings. I understand from various places (like here and the issue comments here, for instance) that history search and recall can lack certain bindings and functionality that people like myself may have become accustomed to in bash or other shells.
That being the case, I want to understand how best to do search in vi mode in fish. Judging from the following post from a main contributor to the project: https://github.com/fish-shell/fish-shell/issues/2271#issuecomment-127585955
These bindings should do something:
bind u history-search-backward
bind \cr history-search-forward
bind '[' history-token-search-backward
bind ']' history-token-search-forward
bind -M insert \cp history-search-backward
bind -M insert \cn history-search-forward
Can someone explain to me how any of those work in vi mode? How do you search backward for a term using u
, for instance? And how does [
work to search for a token backwards?
I'm struggling to understand the docs. Take this for example: https://fishshell.com/docs/current/interactive.html#command-mode
[ and ] search the command history for the previous/next token
containing the token under the cursor before the search was
started. See the history section for more information on history
searching.
OK. So in insert mode, I enter a substring to search on. Then in command mode I try [
and ]
, but they seem to do nothing. Can someone help me understand what I am missing?