Skip to content

Instantly share code, notes, and snippets.

@y16ra
Created July 31, 2024 01:32
Show Gist options
  • Save y16ra/87923df8dd791822dd93615418835a1b to your computer and use it in GitHub Desktop.
Save y16ra/87923df8dd791822dd93615418835a1b to your computer and use it in GitHub Desktop.
enable cdr command
if [[ -n $(echo ${^fpath}/chpwd_recent_dirs(N)) && -n $(echo ${^fpath}/cdr(N)) ]]; then
autoload -Uz chpwd_recent_dirs cdr add-zsh-hook
add-zsh-hook chpwd chpwd_recent_dirs
zstyle ':completion:*' recent-dirs-insert both
zstyle ':chpwd:*' recent-dirs-default true
zstyle ':chpwd:*' recent-dirs-max 1000
zstyle ':chpwd:*' recent-dirs-file "$HOME/.cache/chpwd-recent-dirs"
fi
@y16ra
Copy link
Author

y16ra commented Jul 31, 2024

Ensure the history file exists and has some initial content

touch "$HOME/.cache/chpwd-recent-dirs"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment