I’m really impressed with Fish’s autocomplete functionality. However there is one feature in Bash that I’m unable to find in Fish. When you press Ctrl+R in Bash and begin to type out a term, a search is done on your .bash_history to find matches in reverse order.

Is there a similar functionality in Fish?

  • The thing to note about fish's up/down arrow feature is that it is far less powerful than bash's reverse-search. This becomes obvious when you can remember your argument, or an option, but not from the first part of your command. Reverse search does a fuzzy inline search, fish just checks for identical start of sentence. – Kasper HJ Jun 4 '15 at 8:44
  • 7
    @KasperHJ, I think your comment may be out of date. I typed sta and pressed up, and it found git stash list. I just started using Fish recently, so I don't know if this is a recently-added feature or something that has been in Fish for a long time. – Elias Zamaria Aug 7 '16 at 19:34

I've never used fish myself but a cursory google search brought up this page which states that

Powerful History Mechanism

Modern shells save previous commands in a command history. You can view earlier commands by using the up and down arrows. Fish extends this concept by integrating the history search functionality. To search the history, simply type in the search string, and press the up arrow. By using the up and down arrow, you can search for older and newer matches. The fish history automatically removes duplicate matches and the matching substring is highlighted. These features make searching and reusing previous commands much faster.

Is that what you are looking for? It seems quite similar to bash's.

| improve this answer | |

fish doesn't implement incremental history search, although it seems to come up fromtime to time. The pre-2.0 documentation has a "Missing features and bugs" section 1 which lists incremental history search fairly far down in the "Possible features" list. The fish-users mailing list includes this message from Axel Liljencratz, dated August 21, 2006, in which he says that incremental search would be a nice feature to have.

If you're used to bash-style incremental search, fish history searching does take a bit of getting used to. You have to type the search term first, and you move up and down matching entries with up- and down- arrow. But I suppose you get used to it.

| improve this answer | |

You can use : https://github.com/junegunn/fzf

this library provide powerful search for fish shell.

| improve this answer | |

There is a feature request opened in the fish bug tracker:


Someone already implemented a workaround for this:


| improve this answer | |

Far better Ctrl+r reverse searches with FZF and fzf fish plugin, using the Triton fish package manager, configured to use The Silver Searcher.


triton jethrokuan/fzf
set -U FZF_FIND_FILE_COMMAND "ag -l --hidden --ignore .git"
set -U FZF_DEFAULT_OPTS "--height 40% --layout=reverse --border"

On Mac OS, to install the prereqs:

brew install the_silver_searcher
brew install fzf
| improve this answer | |

Using up and down arrows it's not a good alternative to Ctrl+R, because if the phrase you are looking for it is really deep in the history, you'll have to hit up/down keys a lot! I just use history | grep -i [phrase]

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.