2 setopt autocd extendedglob
6 # typeset -U makes every array entry unique; /usr/{pkg,local} are bsdisms
8 path=({~/,/,/usr/}sbin {~/,/,/usr/}bin /usr/pkg/{s,}bin /usr/X11R{7,6}/bin
9 /usr/local/{s,}bin $path)
21 bindkey "^[[7~" beginning-of-line #Home
22 bindkey -a "^[[7~" beginning-of-line
23 bindkey "^[[8~" end-of-line #End
24 bindkey -a "^[[8~" end-of-line
25 bindkey "^[[3~" delete-char #Del
26 bindkey -a "^[[3~" delete-char
28 autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
29 zle -N up-line-or-beginning-search
30 zle -N down-line-or-beginning-search
31 [[ -n "$key[Up]" ]] && bindkey -- "$key[Up]" up-line-or-beginning-search
32 [[ -n "$key[Down]" ]] && bindkey -- "$key[Down]" down-line-or-beginning-search
40 local p="ps -aSdxwwouser=USR -ogroup=GRP -opid,nice=N \
41 -o%cpu,%mem,tt,stat,start=START -oetime,command | ${PAGER:-more} -Se"
46 alias va="source bin/activate"
51 if [[ "$OSTYPE" = "freebsd" ]] {
52 # don't confirm if only a few files are deleted
61 if [[ "$TERM" = "wsvt25" ]] {
67 PROMPT='%F{$VICOL}%n'"$f"'@%F{$VICOL}%2m'"$f"'%(?../%F{red}$?'"$f"')%# '
68 RPROMPT='%F{yellow}${vcs_info_msg_0_:-%~}'"$f"' %T'
71 ## change color based on zle vi mode
72 function zle-line-init zle-keymap-select {
73 VICOL="${${KEYMAP:/vicmd/red}:/(main|viins)/green}"
77 zle -N zle-keymap-select
81 zstyle ':vcs_info:*' enable git
82 zstyle ':vcs_info:git*' formats "%c%u%%F{green}%r/%b%%F{white}/%%F{yellow}%S%%f"
83 zstyle ':vcs_info:git*' actionformats "%%F{red}(%a)$p %c%u%%F{green}%r/%b$p/%%F{yellow}%S$p"
84 #zstyle ':vcs_info:git*' check-for-changes true #too slow
85 zstyle ':vcs_info:git*:.dotfiles' check-for-changes true
86 zstyle ':vcs_info:git*' check-for-staged-changes true
87 zstyle ':vcs_info:git*' stagedstr "%F{blue}+"
88 zstyle ':vcs_info:git*' unstagedstr "%F{red}*"
93 # change terminal title
94 print -Pn "\e]2;%(1j,%j,)%#${SSH_CLIENT+$USER@$HOST:}%~\e\\"
97 # bell if exec takes 5s
98 if ((SECONDS - _exectime >= 5)) print "\a"
101 # change terminal title to show command
102 print -Pnf "\e]2;%s\e\\" "%#${SSH_CLIENT+$USER@$HOST:}$1"
103 # save last exec time for bell
111 if [[ "$OSTYPE" = "freebsd" ]] {
113 bindkey "^[[H" beginning-of-line #Home
114 bindkey -a "^[[H" beginning-of-line
115 bindkey "^[[F" end-of-line #End
116 bindkey -a "^[[F" end-of-line
119 function s { sysctl hw.snd.default_unit${1:+\=$1} }
121 ## install port dependencies from pkg (like pkgsrc `bmake bin-install')
125 sudo pkg install -AU $(make ${1}-depends-list |
126 sed 's_/usr/ports/_ _' | tr -d '\n')
128 *) echo "Usage: \`portpkg <build|run>' in a port directory"
134 # The following lines were added by compinstall
135 zstyle ':completion:*' auto-description 'specify: %d'
136 zstyle ':completion:*' expand suffix
137 zstyle ':completion:*' format '# %d'
138 zstyle ':completion:*' group-name ''
139 zstyle ':completion:*' ignore-parents parent
140 zstyle ':completion:*' insert-unambiguous false
141 zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
142 zstyle ':completion:*' list-prompt '%B%i%b'
143 zstyle ':completion:*' list-suffixes true
144 zstyle ':completion:*' matcher-list '' 'm:{[:lower:]}={[:upper:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[._-]=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*'
145 zstyle ':completion:*' menu select=1
146 zstyle ':completion:*' original false
147 zstyle ':completion:*' select-prompt '%B%l%b'
148 zstyle ':completion:*' verbose true
149 zstyle :compinstall filename '/home/ds6/.zshrc'
151 autoload -Uz compinit
153 # End of lines added by compinstall
155 # vim: ts=8:sts=4:sw=4:et:tw=79