Add upstream oh_my_zsh repo
This commit is contained in:
@@ -6,4 +6,10 @@ for new shells, unless:
|
||||
- The plugin is already loaded.
|
||||
- The current `$PWD` is not `$HOME`.
|
||||
|
||||
Adds `lwd` function to jump to the last working directory.
|
||||
Also adds `lwd` function to jump to the last working directory.
|
||||
|
||||
To use it, add `last-working-dir` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... last-working-dir)
|
||||
```
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
typeset -g ZSH_LAST_WORKING_DIRECTORY
|
||||
|
||||
# Updates the last directory once directory is changed
|
||||
chpwd_functions+=(chpwd_last_working_dir)
|
||||
autoload -U add-zsh-hook
|
||||
add-zsh-hook chpwd chpwd_last_working_dir
|
||||
chpwd_last_working_dir() {
|
||||
if [ "$ZSH_SUBSHELL" = 0 ]; then
|
||||
local cache_file="$ZSH_CACHE_DIR/last-working-dir"
|
||||
|
||||
Reference in New Issue
Block a user