Looking for maximum productivity #1: fasd vs autojump vs jump

Moving in the terminal is one of those things… fun the first three times, and an absolute pain the rest of them. Most terminal quickly users find out that there are better ways of roaming inside the filesystem, using aliases, and using tabs to autocomplete. After a while your rc file becomes piled with stuff like alias p='cd $HOME/Projects', and things start to get hard to manage from there. You begin forgetting things, and there isn’t much point in maintaining twenty aliases if you will only remember four of them in three weeks. One can do better. In the near future, I’ll be posting more about terminal utilities. Today’s post is about fasd, my favorite “directory jumper”.

I will talk about the installation process, tweaks, and outcome.

If you use zsh you have some decent options besides fasd, I tried jump and autojump. The downside of jump is that you have to mark each of the directories you want to be able to jump to, it’s basically a fancy way of creating aliases. autojump remembers the directories you visit the most and makes your life easier by remembering them for you.

So if you want do go to ~/Documents/Github/your-great-code-repo/. All you have to type is j grea, our j code-r. auto-jump will know how to get you there because it remembers all the paths you’ve been to. (j is short for autojump).

autojump was almost everything I looked for, the only problem I found was the auto-complete. It was dirty, and buggy. When using tab completion, the file names were prepended with *__N__/*, which made it unbearably ugly to look at. Also, sometimes, when using tab completion the same folder would appear more than one time, for unknown reason, polluting the screen and forcing me to spend more time deciding which option to pick. Read about the issue here.

The right option for me was ultimately fasd.


As described in the repo README the installation in MacOs, was quite straightforward. I installed it via brew (brew install fasd), and added the following to my .zshrc file.

plugins=(... fasd)

# fasd init
eval "$(fasd --init zsh-wcomp-install zsh-hook zsh-ccomp)"
alias j='fasd_cd -d'

The j alias makes fasd feel the way autojump was supposed to. Note that fasd is designed to do more than changing directories, but that’s the feature I was aiming to discuss in this post.

I feel like I kind of rage posted this, things like this should be simple by default. Take care.

· terminal, iterm, zsh, fasd