X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/blobdiff_plain/b484bab8b0951f1f1aa631b62fd486b685c6e0ff..390f6e6794cd2b91450cc2731c2e403062e9e650:/etc/zsh/.zshrc diff --git a/etc/zsh/.zshrc b/etc/zsh/.zshrc index bfe0d9f..55e9c6e 100644 --- a/etc/zsh/.zshrc +++ b/etc/zsh/.zshrc @@ -22,12 +22,6 @@ export SAVEHIST=1000 export PYTHONSTARTUP=${XDG_CONFIG_HOME:-~/.config}/pythonrc ## vim export VIMINIT='let$MYVIMRC=($XDG_CONFIG_HOME??($HOME."/.config"))."/vim/.vimrc"|execute"source"$MYVIMRC' -## wayland/gui env -export XDG_SESSION_TYPE=${XDG_SESSION_TYPE:-wayland} -export QT_QPA_PLATFORM=${QT_QPA_PLATFORM:-wayland-egl} -export QT_WAYLAND_DISABLE_WINDOWDECORATION=${QT_WAYLAND_DISABLE_WINDOWDECORATION:--1} -export SDL_VIDEODRIVER=${SDL_VIDEODRIVER:-wayland} -export TERMINAL=${TERMINAL:-$(whence -p konsole footclient urxvt xterm)[(f)1]} ### imports autoload -Uz zmv @@ -143,7 +137,7 @@ if [[ ! -v _sev_force_zkbd && ( -v terminfo || -v termcap ) ]] { if [[ -n $keymap ]] { source $keymap } else { - echo "Failed to source keymap file $keymap" >&2 + echo -E "Failed to source keymap file $keymap" >&2 } unfunction find_keymap; unset keymap } @@ -208,6 +202,12 @@ alias se=sudoedit # be paranoid alias cp='cp -ip' alias mv='mv -i' +alias zm='noglob zmv -WiM' +alias zc='noglob zmv -WiC' +alias zl='noglob zmv -WiL' +alias sm='noglob zmv -Wip"sudo mv"' +alias sc='noglob zmv -Wip"sudo cp"' +alias sl='noglob zmv -Wip"sudo ln"' if [[ "$OSTYPE" =~ '^freebsd' ]] { # don't confirm if only a few files are deleted alias rm='rm -I' @@ -248,13 +248,17 @@ alias pa=$ps alias spa="sudo $ps" unset ps ## git +alias g=git alias gd='git diff' alias gdh='git diff HEAD' alias ga='git add' +alias ga.='git add .' alias gc='git commit' alias gca='git commit --amend' alias gp='git push' alias gu='git pull' +alias gl='git log' +alias gt='git tree' # from gitconfig ## cd/zoxide function up { \cd $(printf '../%.0s' {1..${1:-1}}) @@ -265,8 +269,14 @@ if [[ -v commands[zoxide] ]] { eval "${$(zoxide init zsh):s#_files -/#_cd#}" alias cd=z } +alias cd..=up ## dotfiles -alias dfu='d=${$(echo ~/.zshenv):P:h:h};GIT_DIR=$d/.git GIT_WORK_TREE=$d git pull' +alias dfu='d=${$(echo -E - ~/.zshenv):P:h:h};GIT_DIR=$d/.git GIT_WORK_TREE=$d { + git pull && + git submodules init && + git submodules sync && + git submodules update +}' ### hooks autoload -Uz add-zsh-hook @@ -339,7 +349,7 @@ case $OSTYPE; in function vol { if [[ -z "$1" ]] { for x in $(mixerctl -a | grep 'outputs\.master'); do - echo $x + echo -E - $x done return }