X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/blobdiff_plain/152474f63f971b4c543a896c11f2c6db5a4c2d41..4f4710136460159118320a2c2a5e1515746e52ac:/base/.zshrc?ds=sidebyside diff --git a/base/.zshrc b/base/.zshrc index eec9016..96f14c5 100644 --- a/base/.zshrc +++ b/base/.zshrc @@ -34,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 } @@ -56,24 +56,28 @@ if [[ "$OSTYPE" =~ '^(free|net)bsd' ]] { } ## ps local p= -if which pstree >/dev/null 2>&1 && ! check-busybox pstree { +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 check-busybox ps { +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 @@ -205,7 +209,7 @@ compinit ## prompt # do this last so prompt can potentially override autoload -Uz promptinit && promptinit -prompt ds6 +prompt arrows ### unset imports