diff options
Diffstat (limited to 'config/zsh/.zshrc')
| -rw-r--r-- | config/zsh/.zshrc | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/config/zsh/.zshrc b/config/zsh/.zshrc index 8ee4622..57b49c5 100644 --- a/config/zsh/.zshrc +++ b/config/zsh/.zshrc @@ -59,10 +59,22 @@ export SAVEHIST=5000 # executed when changing directory chpwd() { + # ls on cd if not too much files content="$(find . -maxdepth 1 | wc -l)" ([ "$content" -lt 20 ] && ls -l) || 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 + # [ ! -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 @@ -73,7 +85,7 @@ zle -N exit_zsh bindkey '^D' exit_zsh # shellcheck disable=SC2034,SC2039,SC3030 -fignore=(o hi) # ignore extensions in autocomplete +fignore=(.o .hi) # ignore extensions in autocomplete # set tab to 4 spaces tabs 4 @@ -96,3 +108,33 @@ if [ "$(uname)" = 'Linux' ] then . /usr/share/doc/pkgfile/command-not-found.zsh fi + +# upload-config() { +# scp -qr "$HOME/.vim" cce424r@ds-train: +# scp -q "$HOME/.config/vim/vimrc" cce424r@ds-train:.vimrc +# +# scp -qr "$HOME/.vim" cce424r@ds-attic: +# scp -q "$HOME/.config/vim/vimrc" cce424r@ds-attic:.vimrc +# } + +# >>> conda initialize >>> +# !! Contents within this block are managed by 'conda init' !! +__conda_setup="$('/usr/local/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)" +# shellcheck disable=SC2181 +if [ $? -eq 0 ]; then + eval "$__conda_setup" +else + if [ -f "/usr/local/anaconda3/etc/profile.d/conda.sh" ]; then + . "/usr/local/anaconda3/etc/profile.d/conda.sh" + else + export PATH="/usr/local/anaconda3/bin:$PATH" + fi +fi +unset __conda_setup + +if [ -f "/usr/local/anaconda3/etc/profile.d/mamba.sh" ]; then + . "/usr/local/anaconda3/etc/profile.d/mamba.sh" +fi +# <<< conda initialize <<< + +eval "$(opam env)" |
