X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/blobdiff_plain/1ef46e010e2dc017f60cddfabf6e669a0469ef3f..6d54344e74d961369b15acb46cc95ae8da282c79:/base/.zshrc diff --git a/base/.zshrc b/base/.zshrc index 7890dad..9ce0d1e 100644 --- a/base/.zshrc +++ b/base/.zshrc @@ -4,24 +4,46 @@ setopt NO_BEEP NO_CLOBBER setopt AUTO_CD CDABLE_VARS ## completion setopt GLOB_COMPLETE -## line +## globbing setopt EXTENDED_GLOB GLOB_DOTS MARK_DIRS NOMATCH NUMERIC_GLOB_SORT -## prompt -setopt PROMPT_SUBST ## jobs -setopt AUTO_CONTINUE +setopt AUTO_CONTINUE LONG_LIST_JOBS ## history setopt NO_HIST_SAVE_BY_COPY HIST_IGNORE_DUPS SHARE_HISTORY HIST_REDUCE_BLANKS +### imports +autoload -Uz zmv +autoload -Uz zmathfunc && zmathfunc + +### exports +## common +export EDITOR=vim +export PAGER=less +## grep +# XXX: deprecated in GNU +export GREP_OPTIONS=--color=auto +## histfile +export HISTFILE=~/.histfile +export HISTSIZE=1000 +export SAVEHIST=1000 +## python +export PYTHONSTARTUP=~/.pythonrc +## wayland/sway +# XXX: only do this if we're actually in wayland, but without a start script +export XDG_SESSION_TYPE=wayland +export QT_QPA_PLATFORM=wayland-egl +export QT_WAYLAND_DISABLE_WINDOWDECORATION=-1 +export SDL_VIDEODRIVER=wayland +export TERMINAL=footclient + ### keys -# TODO: investigate "^[[200~" bracketed-paste bindkey -v KEYTIMEOUT=10 ## populate key array if (( $#terminfo == 0 )) { # terminfo is not set or empty function find_keymap { - for f in ${ZDOTDIR:-$HOME}/.zkbd/${TERM}{-${DISPLAY:-${VENDOR}-${OSTYPE}},} + for f in ${ZDOTDIR:-$HOME}/.zkbd/$TERM{-${DISPLAY:-$VENDOR-$OSTYPE},} [[ -f $f ]] && keymap=$f && break } find_keymap @@ -122,8 +144,8 @@ if [[ "$OSTYPE" =~ '^(free|net)bsd' ]] { } else { alias ll='ls -lAFh' } -alias p="${PAGER:-more}" # TODO: make sure more is there or use alternate -alias e="${EDITOR:-vi}" # TODO: make sure vi is there or use alternate +alias p=${PAGER:-more} # TODO: make sure more is there or use alternate +alias e=${EDITOR:-vi} # TODO: make sure vi is there or use alternate alias se=sudoedit # be paranoid alias cp='cp -ip' @@ -136,11 +158,11 @@ if [[ "$OSTYPE" =~ '^freebsd' ]] { alias rm='rm -i' } ## py venv -alias va="source bin/activate" -alias vd="deactivate" +alias va='source bin/activate' +alias vd=deactivate ## ps source ~/bin/.check-busybox -if which pstree >/dev/null 2>&1 && ! check-busybox pstree; then +if [[ -v commands[pstree] ]] && ! check-busybox pstree; then # use pstree, but NOT busybox pstree because it kinda sucks ps="pstree -wg3" elif [[ "$OSTYPE" =~ '^freebsd' ]]; then @@ -163,7 +185,7 @@ if [[ "$(basename "$PAGER")" = "less" ]] { } else { ps="$ps | \"${PAGER:-more}\"" } -alias pa="$ps" +alias pa=$ps alias spa="sudo $ps" unset ps @@ -172,6 +194,7 @@ unset ps function up { cd $(printf '../%.0s' {1..${1:-1}}) } +alias u=up ## zoxide [[ -v commands[zoxide] ]] && eval "$(zoxide init zsh)" @@ -208,7 +231,7 @@ function sev_chpwd { add-zsh-hook chpwd sev_chpwd ### system-specific configs and aliases -case "$OSTYPE"; in +case $OSTYPE; in freebsd*) # colors export CLICOLOR= @@ -291,4 +314,4 @@ prompt arrows ### load site-specific if [[ -f ~/.zshrc.local ]] { source ~/.zshrc.local } -# vim: set et sts=4 sw=4 ts=8 tw=79 : +# vim: et sts=4 sw=4 ts=8 tw=79