I've had my eye on fasd for quite a while now. It does everything that autojump does and more. It didn't look like it would be hard to use fasd in autojump's place, but I am inherently lazy; I wouldn't have been using Autojump if I weren't, and I wasn't in a hurry to switch, since Autojump had already bubbled all of my favorite directories to the top of its list
Shortly before I began my never-ending shell cleanup, I started having problems with autojump. It started showing me a Python stack trace every time I jumped. It was still mostly working, so I didn't worry about it; I figured fixing it could wait until I started cleaning up my shell environment.
What do fasd and autojump do?
Autojump keeps track of the directories that you
cd into, and how often you
cd into them. Later, you only have to type a small part of those often-used directories to change into them:
wonko@zaphod:~$ g cfg wonko@zaphod:~/Steam/SteamApps/oknowton/Team Fortress 2/tf/cfg$
Fasd keeps track of directories, just like autojump. In addition to that, it also keeps track of files, and it provides some interesting
tab completion options for accessing those remembered files. For example, appending
,,f before hitting
TAB will limit completion only to recent files:
wonko@zaphod:~$ emacs medic.cfg,,f<TAB> wonko@zaphod:~$ emacs /home/wonko/Steam/SteamApps/oknowton/Team\ Fortress\ 2/tf/cfg/medic.cfg
fasd and my
I've been using one of the ultimate tools for the lazy, a
go command, for almost two years. A
go command tries to infer your intent based on what it is given as an argument. If the argument matches a directory within the current directory, it will act just like the
cd command. If the argument matches a file in the current directory, it may call
xdg-open in order to open the file using the correct program; my particular implementation opens anything that might be a text file with a text editor. If all else fails, my
go command hands things off to fasd.
go command very nearly worked without modification. My
go command is fairly smart, and it won't attempt to use features that aren't available. Autojump sets up a function for the
j command, while fasd sets up an alias. I was checking for the existence of the alias. Just to be on the safe side, I am now checking for both.
Retraining this old dog
I have been using fasd for almost two months now, and I rarely remember that I have these fancy, new comma prefix and suffix completion helpers. I'd be surprised if I've managed to remember to use them more than a half dozen times.
I'm much more likely to use my old autojump work flow, where I would "jump" to a directory before working a file. If I'm lucky, I'll be trained by this time next year.
- Why I Finally Stuck With zsh
- autojump - The Lazy Way to Change Directories
- Improve Your oh-my-zsh Startup Time (Maybe)
- My Take on "The Go Command"
- Why I Started Using htop
- Automatically Expanding zsh Global Aliases As You Type
- Using and Customizing zsh-syntax-highlighting With oh-my-zsh
- Shell Environment Upgrade and Cleanup: Part 1 - Requirements and Planning
- Initial Release of zsh-dwim
- Cleanup of zsh-dwim
- Shell Environment Upgrade and Cleanup: Part 2 - Migrating from oh-my-zsh to Prezto
- Automatically Expanding zsh Global Aliases - Simplified
- Improving the Behavior of the cd Command in Git Repositories
- A Couple of Useful Snippets from My Shell Config
- A Small Update to `zsh-dwim`: rsync and dstat
- zsh-dwim: Most Recent Remote File Completion
- Upgrading from Autojump to Fasd
- zsh-dwim Now Works on Mac OS X and FreeBSD
- More Powerful Zsh Incremental History Search Using Zaw
- zsh-dwim: Transformations for the Find Command
- shstack: Persistent and Easy to Use Stacks Shared Between Shell Sessions
- zsh-dwim: Small Update For apt and dpkg