mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-20 03:02:29 +01:00
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.
This commit is contained in:
parent
3913106b2e
commit
b3977e9ebd
1 changed files with 10 additions and 0 deletions
10
plugins/tilingaware/tilingaware.plugin.zsh
Normal file
10
plugins/tilingaware/tilingaware.plugin.zsh
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue