retrography
2/5/2016 - 11:32 PM

Persistence layer for ZSH named directories. Introduces the following zsh functions: bm, rbm, lam, tbm

Persistence layer for ZSH named directories. Introduces the following zsh functions: bm, rbm, lam, tbm

# 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