From: sev Date: Tue, 10 Oct 2023 15:28:11 +0000 (-0500) Subject: zsh: update aliases X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/commitdiff_plain/b053a4180a69fb28cf58e3f7513b5042e503352d zsh: update aliases - add git aliases - alias cd to zoxide if present - escape parameter expansion on p/e so env changes are reflected --- diff --git a/etc/zsh/.zshrc b/etc/zsh/.zshrc index 6e5fcca..097d29d 100644 --- a/etc/zsh/.zshrc +++ b/etc/zsh/.zshrc @@ -142,8 +142,8 @@ if [[ "$OSTYPE" =~ '^(free|net)bsd' ]] { } else { alias ll='ls -lAFh' } -alias p=$PAGER -alias e=$EDITOR +alias p=\$PAGER +alias e=\$EDITOR alias se=sudoedit # be paranoid alias cp='cp -ip' @@ -191,11 +191,17 @@ unset ps ### specialized aliases ## go up directories function up { - cd $(printf '../%.0s' {1..${1:-1}}) + \cd $(printf '../%.0s' {1..${1:-1}}) } alias u=up ## zoxide -[[ -v commands[zoxide] ]] && eval "$(zoxide init zsh)" +if [[ -v commands[zoxide] ]] { + eval "$(zoxide init zsh)" + alias cd=zoxide +} +## git +alias ga=git add +alias gdh=git diff HEAD ### hooks autoload -Uz add-zsh-hook