--- /dev/null
+### load site-specific
+if [[ -f ~/.zlogin.local ]] { source ~/.zlogin.local }
+
+# vim: set et sts=4 sw=4 ts=8 tw=79 :
echo logout
clear
+
+### load site-specific
+if [[ -f ~/.zlogout.local ]] { source ~/.zlogout.local }
+
+# vim: set et sts=4 sw=4 ts=8 tw=79 :
-#XXX: ensure we override /etc/profile, gets loaded after .zshenv
-source ~/.zshenv
+### general exports
+export EDITOR=vim
+export PAGER=less
+## lang
+export CHARSET=UTF-8
+export LANG="en_US.UTF-8"
+export LC_CTYPE="$LANG"
+## histfile
+export HISTFILE=~/.histfile
+export HISTSIZE=1000
+export SAVEHIST=1000
+## path
+# /usr/{pkg,local,games} are unix/bsdisms
+typeset -U PATH path
+path=({~/,/,/usr/}sbin {~/,/,/usr/}bin /usr/pkg/{s,}bin /usr/X11R{7,6}/bin
+ /usr/local/{s,}bin /usr/games "${path[@]}")
+export PATH
+typeset -U FPATH fpath
+fpath=(~/.zsh/functions/Prompts "${fpath[@]}")
+export FPATH
+### applications
+## python
+export PYTHONSTARTUP=~/.pythonrc
+## perl
+(( ${+commands[perl]} )) && eval $(perl -I $XDG_DATA_HOME/perl5/lib/perl5 -Mlocal::lib=$XDG_DATA_HOME/perl5 2>/dev/null)
+## gpg
+if (( ${+commands[gpg]} )) {
+ # SSH_AUTH_SOCK should be set in a remote SSH session for passthrough
+ # if it isn't, we are likely the first login shell on the local machine
+ if [[ ! -v SSH_AUTH_SOCK ]] {
+ export GPG_TTY=$(tty)
+ gpg-connect-agent UPDATESTARTUPTTY /bye >/dev/null
+ export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
+ }
+}
+## xdg
+export XDG_CONFIG_HOME=~/etc
+export XDG_CONFIG_DIRS=~/.config:/usr/pkg/etc/xdg:/usr/local/etc/xdg:/etc/xdg
+export XDG_DATA_HOME=~/share
+export XDG_DATA_DIRS=~/.local/share:/usr/pkg/share:/usr/local/share:/usr/share
+export XDG_CACHE_HOME=~/tmp
+export XDG_RUNTIME_DIR=~/tmp
+## grep
+# XXX: deprecated in GNU
+export GREP_OPTIONS=--color=auto
+
+### tmp
t="${TMPDIR:-/tmp}/home-$LOGNAME"
h="$HOME/tmp"
if [[ ! -e "$t" ]] {
- mkdir -m 700 "$t" > /dev/null 2>&1
- #TODO: check if dir exists after mkdir
+ mkdir -m 700 "$t" > /dev/null 2>&1
+ #TODO: check if dir exists after mkdir
}
-#allow opaque entries to override
+#allow opaque entries to override link creation
if [[ ! -e "$h" ]] {
- ln -sf "$t" "$h" > /dev/null 2>&1
+ ln -sf "$t" "$h" > /dev/null 2>&1
}
unset t
unset h
+
+### load site-specific
+if [[ -f ~/.zprofile.local ]] { source ~/.zprofile.local }
+
+# vim: set et sts=4 sw=4 ts=8 tw=79 :
;;
right)
RPROMPT="$dirvcs $clock"
- PROMPT=""
+ PROMPT="%F{$c}>>> "
;;
*)
echo "Unknown prompt mode $m"
}
PROMPT="$PROMPT%(1j,%F{$c}%j,)$vicol%#%F{$p}%n%F{$n}@%F{$p}%2m%(?..%F{$n}/%F{$r}\$?)%F{$n}: "
POSTEDIT="`print -P "%F{$n}%f"`"
+ autoload -Uz vcs_info
zstyle ':vcs_info:git*' formats "%c%u%%F{$p}%r/%b%%F{$n}/%%F{$d}%S%%f"
zstyle ':vcs_info:git*' actionformats "%%F{$r}(%a)%f %c%u%%F{$p}%r/%b%f/%%F{$d}%S%f"
zstyle ':vcs_info:git*' stagedstr "%F{$c}+"
}
function prompt_arrows_precmd {
- # TODO: check if vcs_info is autoloaded
vcs_info
}
}
prompt_arrows_setup "$@"
-# vim: set et fenc=utf-8 ft=zsh sts=4 sw=4 ts=8 tw=0 :
+# vim: set et fenc=utf-8 ft=zsh sts=4 sw=4 ts=8 tw=0 :
-### path
-# /usr/{pkg,local,games} are unix/bsdisms
-typeset -U path
-path=({~/,/,/usr/}sbin {~/,/,/usr/}bin /usr/pkg/{s,}bin /usr/X11R{7,6}/bin
- /usr/local/{s,}bin /usr/games $path)
-
-### posix
-export EDITOR=vim
-export PAGER=less
-export GREP_OPTIONS=--color=auto
-export LANG="en_US.UTF-8"
-export LC_CTYPE="$LANG"
-
-### xdg
-export XDG_CONFIG_HOME=~/etc
-export XDG_CONFIG_DIRS=~/.config:/usr/pkg/etc/xdg:/usr/local/etc/xdg:/etc/xdg
-export XDG_DATA_HOME=~/share
-export XDG_DATA_DIRS=~/.local/share:/usr/pkg/share:/usr/local/share:/usr/share
-export XDG_CACHE_HOME=~/tmp
-export XDG_RUNTIME_DIR=~/tmp
-
-### applications
-export PYTHONSTARTUP=~/.pythonrc
-## perl
-(( ${+commands[perl]} )) && eval $(perl -I $XDG_DATA_HOME/perl5/lib/perl5 -Mlocal::lib=$XDG_DATA_HOME/perl5)
-## gpg
-if (( ${+commands[gpg]} )) {
- export GPG_TTY=$(tty)
- if [[ ! -v SSH_AUTH_SOCK ]] {
- # set up SSH auth socket and start GPG agent
- export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
- }
- gpg-connect-agent updatestartuptty /bye >/dev/null
-}
-
-### freebsd
-if [[ "$OSTYPE" =~ "^freebsd" ]] {
- 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'
-}
-
### load site-specific
-if [[ -f ~/.zshenv.local ]] && [[ ! -v _ZSHENV_LOADED ]] {
- export _ZSHENV_LOADED=
- source ~/.zshenv.local
-}
+if [[ -f ~/.zshenv.local ]] { source ~/.zshenv.local }
+
+# vim: set et sts=4 sw=4 ts=8 tw=79 :
### imports
source ~/bin/.check-busybox
-### user-local fpath
-fpath=(~/.zsh ~/.zsh/functions/Prompts "${fpath[@]}")
-
### options
setopt NO_BEEP NO_CLOBBER
## cd
setopt AUTO_CONTINUE
## history
setopt NO_HIST_SAVE_BY_COPY HIST_IGNORE_DUPS SHARE_HISTORY
-HISTFILE=~/.histfile
-HISTSIZE=1000
-SAVEHIST=1000
### keys
bindkey -v
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
zstyle ':vcs_info:git*' check-for-staged-changes true
## compinit
-# The following lines were added by compinstall
zstyle ':completion:*' auto-description '[arg] %d'
zstyle ':completion:*' expand suffix
zstyle ':completion:*' format '# %d'
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 arrows
+### load site-specific
+if [[ -f ~/.zshrc.local ]] { source ~/.zshrc.local }
### unset imports
unfunction check-busybox
+# support ssh with gpg-agent
enable-ssh-support
-default-cache-ttl 0
+# try to use X11 pinentry if possible
pinentry-program /usr/bin/pinentry-x11