Managing cd bookmarks with apparix
A couple of months ago I discovered apparix: a set of commands which augment
cd
with bookmarks. It really is an amazing feeling when you zap between
multiple directories far away just with a couple of keystrokes! Apparix
provides three commands I use daily: to
, bm
, and apparix
(program
suggests aliasing last one to als
). Here’s how I use it:
$ pwd
/Users/ruslan
$ apparix
--- portals
--- expansions
--- bookmarks
j dotfiles /Users/ruslan/.dotfiles
j blog /Users/ruslan/Projects/ruslanosipov.github.io
$ to blog
$ pwd
/Users/ruslan/Projects/ruslanosipov.github.io
$ cd source/_posts
$ bm posts
added: posts -> /Users/ruslan/Projects/ruslanosipov.github.io/source/_posts
$ to dotfiles
$ pwd
/Users/ruslan/.dotfiles
$ to posts
$ pwd
/Users/ruslan/Projects/ruslanosipov.github.io/source/_posts
The example above is self explanatory: you can see how over the span of a year apparix saves hours of navigating directories you frequent.
Installation
If you don’t like reading manuals, installation might be a confusing. But in reality it’s straightforward, you just need to add some functions or aliases to your shell’s configuration file.
Install apparix
using your favorite package manager, and then pipe examples
apparix offers into your shell’s rc
file.
apparix --shell-examples >> ~/.bashrc
Open your .bashrc
(or another corresponding configuration file), and pick the
preferred way of using apparix: you’ll see functions for bash and aliases for
csh given as examples. Pick whatever works for your shell, source your rc
file, and you’re all set!
Happy jumping!
4 read-only comments
These are the read-only comments I've exported from Disqus (which I no longer use). If you'd like to share your thoughts about this article, you can ✍️ Reply by email.
This sounds great - I installed, piped and sourced, bm foo worked fine, portal worked fine, but to foo only ever gave the error: [apparix] I have nothing for --try-current-last
Any suggestions welcome!
I would check the output of `als` - make sure "foo" is bookmarked (with `bm` command). Then I'd try to bookmark and move around to some other folders with different names. Maybe it's just a weird foo-issue.
als gives me:
___ [apparix] I have nothing for
ls: cannot access : No such file or directory
I've successfully bookmarked a bunch of folders, but not one of them works with 'to' .
'apparix' lists all of the folders I've bookmarked, and expansions, and if I hit tab after entering the first letter of a bookmark after typing 'to' it expands appropriately.
I got all of these same errors when using the extended set of bash commands, which are linked from the official web site and found here:
http://micans.org/apparix/b...
However, those are wrong/out-of-date! As the guide says, run `apparix --shell-examples` and copy over the relevant parts to your .bashrc, and you should be good :)