X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/blobdiff_plain/fab483dd02670f3c8ac23c7ab274a8ddc1d6a6be..325a74cd572e2985156d635096ed2c0452c40aa4:/base/.zshrc diff --git a/base/.zshrc b/base/.zshrc index 6cbdfe0..1f6e987 100644 --- a/base/.zshrc +++ b/base/.zshrc @@ -1,15 +1,26 @@ +### imports +source ~/bin/.check-busybox + ### user-local fpath fpath=(~/.zsh ~/.zsh/functions/Prompts "${fpath[@]}") ### options -setopt autocd extendedglob promptsubst -unsetopt beep - -### history -setopt appendhistory +setopt NO_BEEP NO_CLOBBER +## cd +setopt AUTO_CD CDABLE_VARS +## completion +setopt GLOB_COMPLETE +## line +setopt EXTENDED_GLOB GLOB_DOTS MARK_DIRS NOMATCH NUMERIC_GLOB_SORT +## prompt +setopt PROMPT_SUBST +## jobs +setopt AUTO_CONTINUE +## history +setopt NO_HIST_SAVE_BY_COPY HIST_IGNORE_DUPS SHARE_HISTORY HISTFILE=~/.histfile -HISTSIZE=100 -SAVEHIST=100 +HISTSIZE=1000 +SAVEHIST=1000 ### keys bindkey -v @@ -23,7 +34,7 @@ bindkey "^[[3~" delete-char #Del bindkey -a "^[[3~" delete-char ## history search autoload -Uz up-line-or-beginning-search down-line-or-beginning-search && { - if [[ -n "$key[Up]" ]] { + if [[ -n "$key[Up]" ]] { zle -N up-line-or-beginning-search bindkey -- "$key[Up]" up-line-or-beginning-search } @@ -43,27 +54,31 @@ if [[ "$OSTYPE" =~ '^(free|net)bsd' ]] { } else { alias ll="ls -lAFh" } +alias se=sudoedit ## ps local p= -if { which pstree >/dev/null 2>&1 && \ - [[ ! "$(readlink -f $(which pstree))" =~ "/busybox" ]] } { +if which pstree >/dev/null 2>&1 && ! check-busybox pstree; then # use pstree, but NOT busybox pstree because it kinda sucks p="pstree -wg3" -} elif [[ "$OSTYPE" =~ '^freebsd' ]] { +elif [[ "$OSTYPE" =~ '^freebsd' ]]; then p="ps -aSdfxwwouser=USR -ogroup=GRP -opid,nice=NI \ -o%cpu,%mem,tty,stat,start=START -oetime,command" -} elif [[ "$(readlink -f $(which ps))" =~ "/busybox" ]] { +elif check-busybox ps; then # busybox compatible p="ps -eouser='USR ' -ogroup='GRP ' \ -opid=' PID' -onice=' NI' -ovsz=' MEM' \ -otty,stat,etime,comm" -} else { +else # XXX: untested, posix # TODO: support gnu ps p="ps -eouser=USR -ogroup=GRP -opid,nice=NI \ -opcpu=CPU -ovsz=MEM -otty,stat,etime,comm" +fi +if [[ "$(basename "$PAGER")" = "less" ]] { + p="$p | less -SE" +} else { + p="$p | \"${PAGER:-more}\"" } -p="$p | ${PAGER:-more} -Se" alias pa="$p" alias spa="sudo $p" unset p @@ -159,6 +174,7 @@ case "$OSTYPE"; in ## sound # TODO: test alsa/oss/sndio/portaudio/pulse in order of importance function s() {} + function vol() {} esac ### modules & styles @@ -194,6 +210,10 @@ compinit ## prompt # do this last so prompt can potentially override autoload -Uz promptinit && promptinit -prompt ds6 +prompt arrows + + +### unset imports +unfunction check-busybox # vim: set et sts=4 sw=4 ts=8 tw=79 :