1 # vim: foldmethod=marker:foldlevel=0
4 setopt GLOB_STAR_SHORT GLOB_DOTS EXTENDED_GLOB
6 setopt AUTO_PUSHD PUSHD_IGNORE_DUPS
14 setopt APPEND_HISTORY SHARE_HISTORY INC_APPEND_HISTORY HIST_IGNORE_ALL_DUPS
15 setopt HIST_IGNORE_SPACE
16 HISTORY_IGNORE="(yt* *|t *|t|sdcv *|mmfileget *|arr)"
25 bindkey "^[[1~" beginning-of-line # Home
26 bindkey "^[[4~" end-of-line # End
29 # Command-line editing {{{
30 autoload -U edit-command-line
31 zle -N edit-command-line
32 bindkey -M vicmd v edit-command-line
36 autoload -U history-search-end
37 zle -N history-beginning-search-backward-end history-search-end
38 zle -N history-beginning-search-forward-end history-search-end
39 bindkey "^[[A" history-beginning-search-backward-end
40 bindkey "^[[B" history-beginning-search-forward-end
42 beginning-history-incremental-pattern-search-backward() {
43 zle history-incremental-pattern-search-backward ${BUFFER:gs/ /*/}
45 zle -N beginning-history-incremental-pattern-search-backward
46 bindkey "^[[1;2A" beginning-history-incremental-pattern-search-backward
47 bindkey -M isearch "^[[A" history-incremental-pattern-search-backward
48 bindkey -M isearch "^[[B" history-incremental-pattern-search-forward
52 function zle-line-init zle-keymap-select {
53 local state="%#" timer_val="?"
54 [[ ${KEYMAP} == vicmd ]] && state="+"
55 [[ $timer ]] && timer_val=$(( $SECONDS - $timer ))
57 prompt+="%U${timer_val}%u|"
59 prompt+="%B%F{magenta}${state}%f%b "
64 zle -N zle-keymap-select
71 printf "\a\033]2;\033\\"
81 alias -g W="| wc -l | sed 's/ //g'"
82 alias mc="mc --nomouse"
85 bfs . -name "*$1*" -print
88 alias ssh="TERM=xterm ssh"
89 alias sshnm="ssh -S none"
91 ssh -C -t $1 tmux attach -t0
102 bindkey "
\eOQ" cddotdot # F2
109 bindkey "
\eOS" popdquiet # F4
114 alias Gb="git branch"
115 alias Gc="git checkout"
117 alias Gdc="git diff --cached"
118 alias Gs="git show --show-signature"
119 alias Gm="git diff --name-only --diff-filter=M --relative"
120 alias Gam="git commit --amend"
121 alias Gl="git log --oneline --graph --decorate=short"
122 alias Gld="git log --format=format:'%ai %Cgreen%h%Creset %s'"
124 bindkey -s "
\eOR" " git status --short\n" # F3
132 --dereference-recursive
133 --binary-files=without-match
138 grep $GREP_ARGS $@ | less
140 alias -g G="| grep --colour=always"
145 export GPG_TTY=$(tty)
150 ~/mail/mbox"?Neue Nachrichten in =mbox"
151 ~/mail/arbeit"?Neue Nachrichten in =arbeit"
153 alias arr="mutt -f =arbeit -e 'source ~/.mutt/accounts/stcnet.ru'"
154 alias sent="mutt -f =sent-\`date '+%y-%m'\`"
155 bindkey -s "
\eOP" " inc\n" # F1
159 zstyle ":completion:*:functions" ignored-patterns "_*"
160 zstyle ":completion:*" matcher-list "" 'm:{a-z\-}={A-Z\_}' 'r:|?=** m:{a-z\-}={A-Z\_}'
162 [[ ${words[1]} != man ]] || { _man && return 0 }
163 [[ $CURRENT -eq 1 ]] && _command_names || _files && return 0
164 # MAGIC_EQUAL_SUBST {{{
165 [[ $PREFIX = *\=* ]] || return 1
166 compstate[parameter]=${PREFIX%%\=*}
171 zstyle ":completion:*" completer _mycomp _parameters
172 autoload -U compinit ; compinit -d /tmp/.zcompdump
173 zstyle ":completion:*:default" list-colors ""
178 ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
179 . ~/work/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
180 typeset -A ZSH_HIGHLIGHT_STYLES
181 ZSH_HIGHLIGHT_STYLES[assign]="fg=yellow"
182 ZSH_HIGHLIGHT_STYLES[commandseparator]="fg=red"
183 ZSH_HIGHLIGHT_STYLES[single-hyphen-option]="fg=green,bold"
184 ZSH_HIGHLIGHT_STYLES[double-hyphen-option]="fg=green"
185 ZSH_HIGHLIGHT_STYLES[globbing]="fg=magenta"
186 ZSH_HIGHLIGHT_STYLES[global-alias]="fg=yellow,bold"
187 ZSH_HIGHLIGHT_STYLES[history-expansion]="fg=magenta"
188 ZSH_HIGHLIGHT_STYLES[redirection]="fg=red"
189 ZSH_HIGHLIGHT_STYLES[path]="fg=white,underline"
190 ZSH_HIGHLIGHT_STYLES[path_pathseparator]="fg=white,bold,underline"
194 . ~/work/zsh-autosuggestions/zsh-autosuggestions.zsh
195 ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=cyan"
200 local dir=$(bfs -L ${1:-.} -mindepth 1 \
201 -path "*/\.git" -prune -o \
202 -path "*/\.redo" -prune -o \
203 -type d -print 2>/dev/null |
204 fzf --height 40% --reverse --preview="tree -CN {}")
205 [[ -z $dir ]] || { print -s cd $dir ; cd $dir }
209 # Named directories {{{
212 hash -d ${w[1]}=${~${w[2]}}
217 . ~/work/zsh-autoenv/autoenv.zsh
222 . /usr/local/bin/virtualenvwrapper.sh