Navigating several layers of nested directories is often a pain. On Firefox, it is easy because they have bookmarks. So what I'd like to do to bookmarks a file is to type:$ go --add classes repo/www/public/util/classesThen, to go to this directory, I'd type:$ go classesPreviously I've used symbolic links, to achieve something similar, but I don't want to clutter up my home directory. There are lots of other features that could prove useful. For example, I would like to able to start typing go cl and then hit tab to autocomplete. Sometimes I have multiple copies of a repository checked out and so it would be useful for the program to allow me to create multiple contexts and to set the bookmark relative to the context base directory.So, before I set off on cobbling my own set of scripts together, is there already something like this?
Bookmarks for bash
bash;shell
I was looking for some shell-bookmarking tool for too long, and I'm not satisfied with any of the solutions I found.However, eventually I've come across a great, universal tool: command-line fuzzy finder. It primarily allows you to fuzzy-find files (check the rich gif animation by the link above), but it also allows to feed arbitrary text data to it and filter this data. So, the shortcuts idea is simple: all we need is to maintain a file with paths (which are shortcuts), and fuzzy-filter this file. Here's how it looks: we type cdg command (from cd global, if you like), get a list of our bookmarks, pick the needed one in just a few keystrokes, and press Enter. Working directory is changed to the picked item: It is extremely fast and convenient: usually I just type 3-4 letters of the needed item, and all others are already filtered out. Additionally, of course we can move through list with arrow keys or with Ctrl+j/Ctrl+k.Detailed article about this shortcuts/bookmarks solution is here: Fuzzy shortcuts for your shell.