ohmyzsh/plugins/tilingaware/tilingaware.plugin.zsh
Riccardo Sven Risuleo b3977e9ebd Add tilingaware plugin
Add plugin to save the present working directory over different zsh
sessions. The last change in directory will be preserved.

Add `chpwd' function to change the directory new shells will be opened
in.
2014-06-24 19:42:26 +02:00

10 lines
248 B
Bash

DIRSTACKSIZE=9
DIRSTACKFILE=~/.zdirs
if [[ -f $DIRSTACKFILE ]] && [[ $#dirstack -eq 0 ]]; then
dirstack=( ${(f)"$(< $DIRSTACKFILE)"} )
[[ -d $dirstack[1] ]] && cd $dirstack[1]
fi
function chpwd() {
print -l $PWD ${(u)dirstack}> $DIRSTACKFILE
}