shellmarks
is a shell script that allows you to save and jump to commonly used directories with tab completion.
Works well with both bash
and zsh
.
- git clone git://github.com/Bilalh/shellmarks.git
- cd
shellmarks
- make install (or just source shellmarks.sh )
- source
~/.local/bin/shellmarks.sh
from within your~.bash_profile
or~/.bashrc
(or.zshrc
for zsh)
s <bookmark_name> - Saves the current directory as "bookmark_name"
g <bookmark_name> - Goes (cd) to the directory associated with "bookmark_name"
d <bookmark_name> - Deletes the bookmark
l <bookmark_name> - Lists the specified bookmark associated with "bookmark_name"
l - Lists all available bookmarks
pd <bookmark_name> - `pushd` to the directory associated with "bookmark_name"
_p <bookmark_name> - Prints the directory associated with "bookmark_name"
s - Saves the default directory
g - Goes to the default directory
g - - Goes to the previous directory
# Mac OS X Only
o <bookmark_name> - Open the directory associated with "bookmark_name" in Finder
y <bookmark_name> - Open the directory associated with "bookmark_name" in a new tab
$ cd /var/www/
$ s webfolder
$ cd /usr/local/bin/
$ s localbin
$ l
webfolder /var/www/
localbin /usr/local/bin/
$ g web<tab>
$ g webfolder # cd to /var/www/
$ o webfolder # Open in Finder if on a mac
Stored ~/.sdirs
by default.
Set SDIRS
to use custom location
Set SHELLMARKS_ITERM_SESSION
to a session name to change the session that is launched when using y
in iTerm2 on osx
If SHELLMARK_PWD
is set, pwd
is executed after g
and pd