summaryrefslogtreecommitdiff
path: root/plugins/last-working-dir
diff options
context:
space:
mode:
authorAndrew Janke <andrew@apjanke.net>2015-08-17 20:59:39 -0400
committerAndrew Janke <andrew@apjanke.net>2015-08-17 20:59:39 -0400
commit00eb4658304b010afdfa87f74be673c8aced4961 (patch)
tree3d9e7f95f21265c3c60f10cdca720308bb2421c6 /plugins/last-working-dir
parent47d19cc56425aa7c550d845726111ee8bd9520d1 (diff)
parent192de6bcffb0294e19f4203f6f7dc1a7f3e427be (diff)
downloadzsh-00eb4658304b010afdfa87f74be673c8aced4961.tar.gz
zsh-00eb4658304b010afdfa87f74be673c8aced4961.tar.bz2
zsh-00eb4658304b010afdfa87f74be673c8aced4961.zip
Merge branch 'master' into fold-terminalapp-plugin-into-termsupport
Diffstat (limited to 'plugins/last-working-dir')
-rw-r--r--plugins/last-working-dir/last-working-dir.plugin.zsh5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/last-working-dir/last-working-dir.plugin.zsh b/plugins/last-working-dir/last-working-dir.plugin.zsh
index 4fa6fcc34..c458464ce 100644
--- a/plugins/last-working-dir/last-working-dir.plugin.zsh
+++ b/plugins/last-working-dir/last-working-dir.plugin.zsh
@@ -8,14 +8,15 @@ mkdir -p $ZSH_CACHE_DIR
cache_file="$ZSH_CACHE_DIR/last-working-dir"
# Updates the last directory once directory is changed.
-function chpwd() {
+chpwd_functions+=(chpwd_last_working_dir)
+function chpwd_last_working_dir() {
# Use >| in case noclobber is set to avoid "file exists" error
pwd >| "$cache_file"
}
# Changes directory to the last working directory.
function lwd() {
- [[ ! -r "$cache_file" ]] || cd `cat "$cache_file"`
+ [[ ! -r "$cache_file" ]] || cd "`cat "$cache_file"`"
}
# Automatically jump to last working directory unless this isn't the first time