Quick Link: Terminal navigation utilities

[Tweet]

Bash prompt screenshotIf you follow me on Twitter, you’ve probably seen me express my adoration for autojump, a command-line utility for navigating frequently-used folders. The only problem is that I deal with a lot of repetitive folder hierarchies; for example, the multiple site structures in my web development folder. j css almost certainly isn’t going to take me to the one I was thinking of.

I found a couple of solutions this morning. There’s a package called cdargs which lets you bookmark folders with short names, autocomplete bookmarks, use bookmarks in copy and move actions and list and visually select from all of your bookmarks. I had some conflicts on my system that prevented me from using it, though, so I went with a simpler solution: bashmarks by Huy Nguyen.

Bashmarks lets me do most of what cdargs can do, but with a few less frills (and no conflicts with my setup). I can bookmark the css folder in my blog development folder btcss, and one in a client folder as clientcss and be able to quickly jump to the right one. Bashmarks provides autocomplete, too, so typing g bt[tab] gets me to btcss in a jiffy.

On the way, I also discovered a package called z, which bills itself as “the new j” (in reference to autojump). It takes multiple arguments and uses them to more specifically match the folder you want to jump to. So, if I have a css folder in /brettterpstra/ and in /myclientsite/, I could type z brett css or z client css to distinguish between them. I haven’t bothered with replacing autojump in my config files yet, but this looks promising.