From ca5b53db1e8ce9f7f5c33cd9ddcda63d460942e0 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Wed, 27 Apr 2022 06:04:56 +0200 Subject: Added nvim vim-slime plugin, Updated zsh chpwd hook to cache conda env list command --- config/zsh/.zshrc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'config/zsh') diff --git a/config/zsh/.zshrc b/config/zsh/.zshrc index b524a17..bde98eb 100644 --- a/config/zsh/.zshrc +++ b/config/zsh/.zshrc @@ -65,17 +65,16 @@ chpwd() { echo "$(pwd) contains $content entries" [ "$(uname)" = 'Linux' ] && [ "$(stat -c "%U" .)" = "$USER" ] && touch . # to sort by last cd - # change conda env if name of the directory is the name of an env [ ! -d "$PWD/.git" ] && return name="$(basename "$PWD")" [ "$name" = $CONDA_DEFAULT_ENV ] && return - conda env list | + [ ! -e "$HOME/conda_envs" ] && conda env list > "$HOME/conda_envs" + < "$HOME/conda_envs" \ cut -d ' ' -f 1 | sed -e '/^#/d' -e '/^$/d' -e '/^base$/d' | grep -q "$name" && conda activate "$name" - } # https://wiki.archlinux.org/title/Zsh#Shortcut_to_exit_shell_on_partial_command_line -- cgit