From 0fff9dbd8d760a364edb25cf689d481ce635127c Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Mon, 16 Dec 2019 15:36:20 -0700 Subject: [PATCH] setup cdr --- profiles/develop/zsh/cdr.zsh | 11 +++++++++++ profiles/develop/zsh/default.nix | 1 + 2 files changed, 12 insertions(+) create mode 100644 profiles/develop/zsh/cdr.zsh diff --git a/profiles/develop/zsh/cdr.zsh b/profiles/develop/zsh/cdr.zsh new file mode 100644 index 00000000..0b88918d --- /dev/null +++ b/profiles/develop/zsh/cdr.zsh @@ -0,0 +1,11 @@ +if [[ -z "$ZSH_CDR_DIR" ]]; then + ZSH_CDR_DIR=${XDG_CACHE_HOME:-$HOME/.cache}/zsh-cdr +fi +mkdir -p $ZSH_CDR_DIR +autoload -Uz chpwd_recent_dirs cdr +autoload -U add-zsh-hook +add-zsh-hook chpwd chpwd_recent_dirs +zstyle ':chpwd:*' recent-dirs-file $ZSH_CDR_DIR/recent-dirs +zstyle ':chpwd:*' recent-dirs-max 1000 +# fall through to cd +zstyle ':chpwd:*' recent-dirs-default yes diff --git a/profiles/develop/zsh/default.nix b/profiles/develop/zsh/default.nix index c5163a4b..c5b3d963 100644 --- a/profiles/develop/zsh/default.nix +++ b/profiles/develop/zsh/default.nix @@ -74,6 +74,7 @@ in zshrc = fileContents ./zshrc; sources = with pkgs; [ + ./cdr.zsh "${skim}/share/skim/completion.zsh" "${oh-my-zsh}/share/oh-my-zsh/plugins/sudo/sudo.plugin.zsh" "${oh-my-zsh}/share/oh-my-zsh/plugins/extract/extract.plugin.zsh"