Last active
June 11, 2017 22:52
-
-
Save retrography/9d6e4dde54e451885f40 to your computer and use it in GitHub Desktop.
Persistence layer for ZSH named directories. Introduces the following zsh functions: bm, rbm, lam, tbm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Directory bookmark handler | |
touch ~/.ndirs | |
function rbm() { sed -i "/^$1\t/d" ~/.ndirs; export $1='' } | |
function tbm() { hash -d _="$(pwd)" } | |
function bm() { rbm $1; tbm $1; echo -e "$1\t$(pwd)" >> ~/.ndirs } | |
function lbm() { sort ~/.ndirs } | |
sed -e 's/^/hash -d /' -e 's/\t/="/' -e 's/$/"/' ~/.ndirs | while read line; do eval $line; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment