This my hacking on shellmarks to work with zsh. I recommend using zshmarks
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.shfrom within your~.bash_profileor~/.bashrc(or.zshrcfor zsh)
s <bookmark_name> - Saves the current directory as "bookmark_name"
smgo <bookmark_name> - Goes (cd) to the directory associated with "bookmark_name"
d <bookmark_name> - Deletes the bookmark
lsm <bookmark_name> - Lists the specified bookmark associated with "bookmark_name"
lsm - Lists all available bookmarks
g - an alias for smgo
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
smgo - Goes to the default directory
smgo - - Goes to the previous directory
o <bookmark_name> - Open the directory associated with "bookmark_name" using xdg-open
g - default alias for smgo (see Environment variables)
# 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
$ lsm
webfolder /var/www/
localbin /usr/local/bin/
$ smgo web<tab>
$ smgo webfolder # cd to /var/www/
$ o webfolder # Open in file manager (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 smgo and pd
Set SHELLMARKS_ALIAS to use your own alias. Default is g