Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I love fzf but somehow I can never find a way to naturally make it a part of my workflow.


My biggest tip is to use the '**' shortcut from bash/zsh. My most frequent use case is for running tests, I can type:

   $ be rspec spec/**{tab}

Fzf will open inline, select the file(s) you want and run them (like this https://asciinema.org/a/mYTmT908gvVxZTMAsfPxltULx)

To get this to work I had to add this line to my .zshrc

source /usr/share/zsh/site-functions/fzf


If you don't have the globstar optional behavior enabled in bash this won't work.

From the manual:

If set, the pattern ‘*’ used in a filename expansion context will match all files and zero or more directories and subdirectories. If the pattern is followed by a ‘/’, only directories and subdirectories match.

To enable:

    $ shopt -s globstar
To disable:

    $ shopt -u globstar


The zag ctrl-r integration for fuzzy searching terminal history is amazing. Also you can do * and hit tab and use fzf to grab a file to use as a command line argument.

Fzf is wonderful.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: