### exports
## common
-export EDITOR=vim
-export PAGER=less
+export EDITOR=${$(whence -p nvim vim vi micro nano emacs)[(f)1]}
+export PAGER=${$(whence -p less micro nano more)[(f)1]:s/micro/& -readonly true -multiopen tab/:s/nano/& --view}
## grep
# XXX: deprecated in GNU
export GREP_OPTIONS=--color=auto
export HISTSIZE=1000
export SAVEHIST=1000
## python
-export PYTHONSTARTUP=~/.pythonrc
+export PYTHONSTARTUP=${XDG_CONFIG_HOME:-~/.config}/pythonrc
+## vim
+export VIMINIT='execute "source" ($XDG_CONFIG_HOME??($HOME."/.config"))."/vim/.vimrc"'
## 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
+export TERMINAL=${$(whence -p konsole footclient urxvt xterm)[(f)1]}
### keys
bindkey -v
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:-~}/.zkbd/$TERM{-${DISPLAY:-$VENDOR-$OSTYPE},}
[[ -f $f ]] && keymap=$f && break
}
find_keymap
unset a k v
### abbreviation aliases
-alias h='history -25'
+alias h='fc -l -25'
alias j='jobs -l'
alias l='ls -AF'
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
+alias e=$EDITOR
alias se=sudoedit
# be paranoid
alias cp='cp -ip'
# TODO: similar behavior for non-freebsd, or impliment in zsh
alias rm='rm -i'
}
+[[ -v commands[trash-put] ]] && alias t=trash-put
## py venv
alias va='source bin/activate'
alias vd=deactivate
## ps
-source ~/bin/.check-busybox
+source ~/.local/bin/.check-busybox
if [[ -v commands[pstree] ]] && ! check-busybox pstree; then
# use pstree, but NOT busybox pstree because it kinda sucks
ps="pstree -wg3"
};;
*)
## sound
- # TODO: test alsa/oss/sndio/portaudio/pulse in order of importance
+ # TODO: test alsa/oss/sndio/portaudio/pulse/pipewire in order of importance
function s {}
function vol {}
esac
zstyle ':completion:*' original false
zstyle ':completion:*' select-prompt '%B%l%b'
zstyle ':completion:*' verbose true
-autoload -Uz compinit && compinit
+autoload -Uz compinit
+cache=${XDG_CACHE_HOME:-~/.cache}/zsh
+[[ -d $cache ]] || mkdir -p $cache
+compinit -d $cache/.zcompdump
### prompt
autoload -Uz promptinit && promptinit
prompt arrows
### load site-specific
-if [[ -f ~/.zshrc.local ]] { source ~/.zshrc.local }
+if [[ -f ${ZDOTDIR:-~}/.zshrc.local ]] { source ${ZDOTDIR:-~}/.zshrc.local }
# vim: et sts=4 sw=4 ts=8 tw=79