2 setopt autocd extendedglob
15 bindkey "^[[7~" beginning-of-line #Home
16 bindkey -a "^[[7~" beginning-of-line
17 bindkey "^[[8~" end-of-line #End
18 bindkey -a "^[[8~" end-of-line
19 bindkey "^[[3~" delete-char #Del
20 bindkey -a "^[[3~" delete-char
22 autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
23 zle -N up-line-or-beginning-search
24 zle -N down-line-or-beginning-search
25 [[ -n "$key[Up]" ]] && bindkey -- "$key[Up]" up-line-or-beginning-search
26 [[ -n "$key[Down]" ]] && bindkey -- "$key[Down]" down-line-or-beginning-search
32 if [[ "$OSTYPE" =~ '^(free|net)bsd' ]] {
39 if { which pstree >/dev/null 2>&1 && [[ ! "$(readlink -f $(which pstree))" =~ "/busybox" ]] } {
41 } elif [[ "$OSTYPE" =~ '^freebsd' ]] {
42 p="ps -aSdfxwwouser=USR -ogroup=GRP -opid,nice=NI \
43 -o%cpu,%mem,tty,stat,start=START -oetime,command"
44 } elif [[ "$(readlink -f $(which ps))" =~ "/busybox" ]] {
46 p="ps -eouser='USR ' -ogroup='GRP ' \
47 -opid=' PID' -onice=' NI' -ovsz=' MEM' \
48 -otty,stat,etime,comm"
50 # XXX: untested, posix
51 # TODO: support gnu ps
52 p="ps -eouser=USR -ogroup=GRP -opid,nice=NI \
53 -opcpu=CPU -ovsz=MEM -otty,stat,etime,comm"
55 p="$p | ${PAGER:-more} -Se"
60 alias va="source bin/activate"
65 if [[ "$OSTYPE" =~ '^freebsd' ]] {
66 # don't confirm if only a few files are deleted
69 # TODO: similar behavior for non-freebsd
75 # DEPR: color reset added to NetBSD in PR/53245, following is not needed for recent releases
77 #XXX: can't think of a way to tell if ssh client is on wscons, just kludge 24/7
78 #if [[ "$OSTYPE" = "netbsd" && ( "$TERM" =~ "^wsvt" || "$TERM" =~ '^vt' ) ]] {
84 PROMPT='%F{$VICOL}%n%f@%F{$VICOL}%2m%f%(?../%F{red}$?%f)%# '
85 RPROMPT='%F{yellow}${vcs_info_msg_0_:-%~}%f %T'
87 ## change color based on zle vi mode
88 function zle-line-init zle-keymap-select {
89 VICOL="${${KEYMAP:/vicmd/red}:/(main|viins)/green}"
93 zle -N zle-keymap-select
97 zstyle ':vcs_info:*' enable git
98 zstyle ':vcs_info:git*' formats '%c%u%%F{green}%r/%b%%F{white}/%%F{yellow}%S%%f'
99 zstyle ':vcs_info:git*' actionformats '%%F{red}(%a)%f %c%u%%F{green}%r/%b%f/%%F{yellow}%S%f'
100 #zstyle ':vcs_info:git*' check-for-changes true #too slow
101 zstyle ':vcs_info:git*:dotfiles' check-for-changes true
102 zstyle ':vcs_info:git*' check-for-staged-changes true
103 zstyle ':vcs_info:git*' stagedstr "%F{blue}+"
104 zstyle ':vcs_info:git*' unstagedstr "%F{red}*"
111 # change terminal title
112 print -Pn "\e]2;%(1j,%j,)%#${SSH_CLIENT+$USER@$HOST:}%~\e\\"
115 # bell if exec takes 5s
116 if ((SECONDS - _exectime >= 5)) print "\a"
119 # change terminal title to show command
120 print -Pnf "\e]2;%s\e\\" "%#${SSH_CLIENT+$USER@$HOST:}$1"
121 # save last exec time for bell
122 # XXX: does not run for blank cmdline
126 # echo dir on cwd change
130 ### system-specific configs and aliases
134 bindkey "^[[H" beginning-of-line #Home
135 bindkey -a "^[[H" beginning-of-line
136 bindkey "^[[F" end-of-line #End
137 bindkey -a "^[[F" end-of-line
140 function s { sysctl hw.snd.default_unit${1:+\=$1} }
143 ## install port dependencies from pkg (like pkgsrc `bmake bin-install')
144 #XXX: should probably use package-depends where possible, breaks when
145 # port name is different to package name
146 # (eg. graphics/sdl20 == sdl2, devel/glib20 == glib2, etc)
150 sudo pkg install -AU $(make ${1}-depends-list |
151 sed 's_/usr/ports/_ _' | tr -d '\n')
153 *) echo "Usage: \`portpkg <build|run>' in a port directory"
161 ll /dev/mixer /dev/sound /dev/audio
164 for x in mixer sound audio; do
165 ln -sf /dev/$x"$1" /dev/$x
170 for x in $(mixerctl -a | grep 'outputs\.master'); do
175 mixerctl -w outputs.master"$2"="$1"
179 # TODO: test alsa/oss/sndio/portaudio/pulse in order of importance
182 # The following lines were added by compinstall
183 zstyle ':completion:*' auto-description 'specify: %d'
184 zstyle ':completion:*' expand suffix
185 zstyle ':completion:*' format '# %d'
186 zstyle ':completion:*' group-name ''
187 zstyle ':completion:*' ignore-parents parent
188 zstyle ':completion:*' insert-unambiguous false
189 zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
190 zstyle ':completion:*' list-prompt '%B%i%b'
191 zstyle ':completion:*' list-suffixes true
192 zstyle ':completion:*' matcher-list '' 'm:{[:lower:]}={[:upper:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[._-]=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*'
193 zstyle ':completion:*' menu select=1
194 zstyle ':completion:*' original false
195 zstyle ':completion:*' select-prompt '%B%l%b'
196 zstyle ':completion:*' verbose true
197 zstyle :compinstall filename '/home/ds6/.zshrc'
199 autoload -Uz compinit
201 # End of lines added by compinstall
203 # vim: ts=8:sts=4:sw=4:et:tw=79