A minimalist fuzzy finder – fzf

I am constantly trying to simplify my life. This process includes my digital life as well. Gone are the days when my desktop screen used to be full of shortcuts to various folders I would be working upon. Now, when I open my computer, it greets me with just a nice wallpaper. There are no icons anywhere. Earlier, I used to have the dock (a bar of icons of your favorite apps) at the bottom of the desktop. Now, it has disappeared too and has become a sidebar containing very few icons (file browser,  a shortcut for opening list of apps, and some minimized documents). It shows up gracefully only when I press the window key or hover the mouse there. (I have to keep it for the sake of people who want to do something on my laptop and are irritated by seeing just a screen with wallpaper.)

How do I open a program on your computer? How do I find a folder or file on which I want to work?  I use desktop search via the window key of my computer to do some of these tasks. Yet, I used to end up doing it in the traditional way for some tasks: open a program from a menu, opening the folder by going through the whole hierarchy, and then opening the relevant file. The window key doesn’t always work because it is linked to a program that may not recognize all of the programs or files. The desktop search may not find the file you are looking for or may be too slow.

I solved this problem by using the  zsh terminal along with fzf to fuzzy search for files, folders, and history on my computer. You can think of this approach as a super hack that replaces your window key or any other search app you are using.

I open my terminal (guake) by pressing the F12 key. Then, I do a fuzzy search along with a fzf shortcut to find or launch what I need. There are three main key-bindings for fzf. To search a folder, press alt+c; to search a file, press ctrl+t; and to search a command, press ctrl+r.

What is the fuzzy search? Suppose I need a file called “Fuzzy finder fzf.txt”. I will simply type “Fuzzy”. The fzf script will automatically list all files with the word “Fuzzy” for me to select from. If the list is small, I select the right file by arrow key and press enter to open it. Otherwise, I narrow down the search by typing another word, say “fzf” or “txt”. The idea behind fuzzy search is that I can type any unique set of letters present in the file name and I end up with the file at my fingertips. So, I can find the file “Fuzzy  finder fzf.txt” by simply typing “z z z” if it is the only file whose name contains four z’s.

For a more detailed description, see the post by Ryan Selk. You can download fzf and learn more about it from its GitHub repository by Junegunn Choi.