http://www.ccrnp.ncifcrf.gov/~toms/nowhere/
After checking that out I thought, well it's alright but quite a bit limited too. I don't want a universal database holding all of my bookmarks in my ~/. What I really wanted was a bookmark directory that was only a pro pos in the current context. This has the benefit of contextual focus and minimizing mnemonic collisions. So I invented my own.
I call it BashMarks. So I kind of stole some of the conventions of the aforementioned tool (bm, bms in particular).
BashMarks
Installing it is easy. Just place it in your ~/bin/ folder (which must be in your PATH), and add the line
source ~/bin/bashMarks
to the end of your ~/.bashrc file. Voila! Instant bookmarking.
Quick Summary of features:
- bm MNEMONIC [DIR] - bookmark a directory named MNEMONIC (DIR may be relative or absolute, and if not specified is pwd)
- bml MNEMONIC - bookmark the *last* directory you were in
- bms - recursively search backwards up the path looking for .bookmarkDB and list contents
- g MNEMONIC - "go" to directory tagged MNEMONIC (note recurses up dir-tree looking for .bookmarkDB)
- p MNEMONIC - "pushd" to directory tagged MNEMONIC (ditto recurses searching all parent .bookmarkDB(s))
- g,p supports Bash autocompletion! Try tabbing out commands, or tabbing out to get a list of what bookmarks are available!
Note: there is nothing to create a new database as it's a very simple file, simply "touch .bookmarkDB" in any current or parent directory of your choice.
Also note: currently doesn't support spaces in directory names (who uses those anyway!)
Hey Ryan!!
ReplyDeleteThanks for the notice on the new tool. I'm looking forward to trying it out! Normally I use a combination of 'cd -' 'pushd' and 'popd' to quickly switch between locations but that limits me to only a few directories, this seems to be just what I need.
Mike Kelleher
Yup, pushd/popd are definitely useful. The "p" command calls pushd under the covers!
ReplyDelete