From 88a8ae8307888eeace6b9f4e67584a8d5cb641de Mon Sep 17 00:00:00 2001 From: winston Date: Fri, 9 Dec 2022 07:09:24 +0100 Subject: [PATCH] feat(zsh): add zoxide, load everything optionally --- dot_config/zsh/dot_zshenv | 2 ++ dot_config/zsh/dot_zshrc | 13 ++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/dot_config/zsh/dot_zshenv b/dot_config/zsh/dot_zshenv index 4181242..2fbd37e 100644 --- a/dot_config/zsh/dot_zshenv +++ b/dot_config/zsh/dot_zshenv @@ -5,6 +5,8 @@ export XDG_DATA_HOME="$HOME/.local/share" export XDG_CACHE_HOME="$HOME/.cache" export EDITOR="nvim" +export SUDO_EDITOR="nvim" +export TERMINAL="wezterm-gui" export HISTFILE="$XDG_CONFIG_HOME/zsh/history" export LESSHISTFILE="-" # don't write a less history export GNUPGHOME="$XDG_CONFIG_HOME/gnupg" diff --git a/dot_config/zsh/dot_zshrc b/dot_config/zsh/dot_zshrc index 0af42ef..679be57 100644 --- a/dot_config/zsh/dot_zshrc +++ b/dot_config/zsh/dot_zshrc @@ -1,10 +1,11 @@ # vim:ft=zsh:fenc=utf-8:fdm=marker # load starship -eval "$(starship init zsh)" +[[ -x "$(command -v starship)" ]] && eval "$(starship init zsh)" ### plugins via antigen {{{ # don't pollute $HOME with antigen ADOTDIR="$XDG_DATA_HOME/antigen" +# bootstrap antigen if [[ ! -d "$ADOTDIR" ]]; then mkdir -p "$ADOTDIR" curl -L https://git.io/antigen > "$ADOTDIR/antigen.zsh" @@ -79,6 +80,8 @@ elif [ -x "$(command -v bat)" ]; then alias cat='bat' fi +[[ -x "$(command -v zoxide)" ]] && eval "$(zoxide init zsh)" + # use neovim as vim, if installed if [[ -x "$(command -v nvim)" ]]; then alias vim='nvim' @@ -167,14 +170,10 @@ function debugnvim() { ### languages & frameworks {{{ # python, my old friend -if [ -x "$(command -v pyenv)" ]; then - eval "$(pyenv init -)" -fi +[[ -x "$(command -v pyenv)" ]] && eval "$(pyenv init -)" # ruby -if [ -x "$(command -v rbenv)" ]; then - eval "$(rbenv init - zsh)" -fi +[[ -x "$(command -v rbenv)" ]] && eval "$(rbenv init - zsh)" # node [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"