X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/blobdiff_plain/186423fe66144fbe2335fd9ca716fdea6cb55712..8650c486663161fc96e7aa837709971b8a02359d:/base/.zshrc?ds=sidebyside diff --git a/base/.zshrc b/base/.zshrc index e06c318..644e178 100644 --- a/base/.zshrc +++ b/base/.zshrc @@ -1,5 +1,5 @@ -### user-local fpath -fpath=(~/.zsh ~/.zsh/functions/Prompts "${fpath[@]}") +### imports +source ~/bin/.check-busybox ### options setopt NO_BEEP NO_CLOBBER @@ -15,9 +15,6 @@ setopt PROMPT_SUBST setopt AUTO_CONTINUE ## history setopt NO_HIST_SAVE_BY_COPY HIST_IGNORE_DUPS SHARE_HISTORY -HISTFILE=~/.histfile -HISTSIZE=1000 -SAVEHIST=1000 ### keys bindkey -v @@ -31,7 +28,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 } @@ -51,27 +48,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 @@ -125,6 +126,10 @@ case "$OSTYPE"; in bindkey "^[[F" end-of-line #End bindkey -a "^[[F" end-of-line + # colors + export CLICOLOR= + export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=46;34:cd=43;34:su=41;30:sg=46;30:tw=42;30:ow=43;30' + ## sound function s { sysctl hw.snd.default_unit${1:+\=$1} } alias vol mixer @@ -167,18 +172,18 @@ case "$OSTYPE"; in ## sound # TODO: test alsa/oss/sndio/portaudio/pulse in order of importance function s() {} + function vol() {} esac ### modules & styles ## vcs -autoload -Uz vcs_info zstyle ':vcs_info:*' enable git #zstyle ':vcs_info:git*' check-for-changes true #too slow zstyle ':vcs_info:git*:dotfiles' check-for-changes true zstyle ':vcs_info:git*' check-for-staged-changes true +autoload -Uz vcs_info ## compinit -# The following lines were added by compinstall zstyle ':completion:*' auto-description '[arg] %d' zstyle ':completion:*' expand suffix zstyle ':completion:*' format '# %d' @@ -193,15 +198,17 @@ zstyle ':completion:*' menu select=1 zstyle ':completion:*' original false zstyle ':completion:*' select-prompt '%B%l%b' zstyle ':completion:*' verbose true -zstyle :compinstall filename '/home/ds6/.zshrc' - -autoload -Uz compinit -compinit -# End of lines added by compinstall +autoload -Uz compinit && compinit ## prompt -# do this last so prompt can potentially override +# do this last so prompt can potentially override other settings autoload -Uz promptinit && promptinit -prompt ds6 +prompt arrows + +### load site-specific +if [[ -f ~/.zshrc.local ]] { source ~/.zshrc.local } + +### unset imports +unfunction check-busybox # vim: set et sts=4 sw=4 ts=8 tw=79 :