autoload -U compinit promptinit
compinit
promptinit
prompt walters
[ "$SSH_CLIENT" ] && PS1="%B%F{red}(ssh)%b%f $PS1"
setopt AUTO_CD AUTO_PUSHD COMPLETE_ALIASES EXTENDED_GLOB HIST_IGNORE_ALL_DUPS \
HIST_IGNORE_SPACE INC_APPEND_HISTORY NO_HASH_DIRS NUMERIC_GLOB_SORT \
PROMPT_SP PUSHD_SILENT SH_WORD_SPLIT TRANSIENT_RPROMPT
zstyle ':completion:*:sudo:*' environ PATH="$SUDO_PATH:$PATH"
zstyle ':completion::complete:*' use-cache 1
alias alarm='play -q -n synth 1.5 sin 440 fade h 0 1.5 1.5 vol 0.5 >/dev/null \
2>&1'
alias cdirname='cd "$(dirname -- "$_")"'
alias edit='$EDITOR'
alias emerge_sync='sudo eix-sync'
alias emerge_update='sudo emerge --update --deep --changed-use \
--with-bdeps=y --keep-going @world'
alias eurobeat='printf "%s\n" ~/"Data/Music tools & data/Initial D Selection"/*.flac | shuf | \
mpv --playlist=- --replaygain=track'
alias ffmpeg='ffmpeg -hide_banner'
alias ffprobe='ffprobe -hide_banner'
alias grep='grep --color=auto'
alias ls='ls --color=auto'
alias ll='ls -lh'
alias la='ls -lha'
alias lsblk='lsblk -o NAME,MODEL,PARTLABEL,FSTYPE,SIZE,MOUNTPOINT'
alias make='make -j$(nproc)'
alias odhex='od -Ax -t x1z'
alias rsync='rsync --info=progress2 --sparse --progress --human-readable'
alias rsync_vfat='rsync --no-owner --no-group --no-perms --modify-window=2'
alias startx='startx -- -nolisten tcp -nolisten local'
alias tmux='tmux -u'
alias rlsbcl='rlwrap -q \" -m -O "^\*>" sbcl'
# Only strips CSI and OSC
alias ansi_strip="sed -E 's#\x1b(\[[\\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]|\][0-9];[^\x1c\x07]*[\x1c\x07])##g'"
source ~/.zkbd/$TERM
autoload zkbd
[ ${key[Backspace]} ] && bindkey "${key[Backspace]}" backward-delete-char
[ ${key[Insert]} ] && bindkey "${key[Insert]}" overwrite-mode
[ ${key[Home]} ] && bindkey "${key[Home]}" beginning-of-line
[ ${key[PageUp]} ] && bindkey "${key[PageUp]}" up-line-or-history
[ ${key[Delete]} ] && bindkey "${key[Delete]}" delete-char
[ ${key[End]} ] && bindkey "${key[End]}" end-of-line
[ ${key[PageDown]} ] && bindkey "${key[PageDown]}" down-line-or-history
[ ${key[Up]} ] && bindkey "${key[Up]}" up-line-or-search
[ ${key[Left]} ] && bindkey "${key[Left]}" backward-char
[ ${key[Down]} ] && bindkey "${key[Down]}" down-line-or-search
[ ${key[Right]} ] && bindkey "${key[Right]}" forward-char
[ ${key[PageUp]} ] && bindkey "${key[PageUp]}" \
history-beginning-search-backward
[ ${key[PageDown]} ] && bindkey "${key[PageDown]}" \
history-beginning-search-forward
[ ${key[Ctrl+Left]} ] && bindkey "${key[Ctrl+Left]}" emacs-backward-word
[ ${key[Ctrl+Right]} ] && bindkey "${key[Ctrl+Right]}" emacs-forward-word
my-kill-region()
{
[ $REGION_ACTIVE -eq 0 ] && zle backward-kill-word || zle kill-region
}
zle -N my-kill-region
bindkey -e '^W' my-kill-region
bindkey -e -s '^[r' 'ranger\n'