1 # vim: foldmethod=marker:foldlevel=0
4 setopt INTERACTIVE_COMMENTS
5 setopt GLOB_STAR_SHORT GLOB_DOTS EXTENDED_GLOB
7 setopt AUTO_PUSHD PUSHD_IGNORE_DUPS
15 setopt APPEND_HISTORY SHARE_HISTORY INC_APPEND_HISTORY HIST_IGNORE_ALL_DUPS
16 setopt HIST_IGNORE_SPACE
17 HISTORY_IGNORE="(yt* *|t *|t|sdcv *|mmfileget *|arr)"
26 bindkey "^[[1~" beginning-of-line # Home
27 bindkey "^[[4~" end-of-line # End
30 # Command-line editing {{{
31 autoload -U edit-command-line
32 zle -N edit-command-line
33 bindkey -M vicmd v edit-command-line
37 autoload -U history-search-end
38 zle -N history-beginning-search-backward-end history-search-end
39 zle -N history-beginning-search-forward-end history-search-end
40 bindkey "^[[A" history-beginning-search-backward-end
41 bindkey "^[[B" history-beginning-search-forward-end
43 beginning-history-incremental-pattern-search-backward() {
44 zle history-incremental-pattern-search-backward ${BUFFER:gs/ /*/}
46 zle -N beginning-history-incremental-pattern-search-backward
47 bindkey "^[[1;2A" beginning-history-incremental-pattern-search-backward
48 bindkey -M isearch "^[[A" history-incremental-pattern-search-backward
49 bindkey -M isearch "^[[B" history-incremental-pattern-search-forward
53 function zle-line-init zle-keymap-select {
54 mode_vi=${${KEYMAP/vicmd/+}/(main|viins)/-}
55 [[ $timer ]] && timer_show=$(( $SECONDS - $timer ))
57 prompt+="%U${timer_show}%u|"
60 prompt+="%B%F{magenta}%#%f%b "
65 zle -N zle-keymap-select
72 printf "\a\033]2;\033\\"
82 alias -g W="| wc -l | sed 's/ //g'"
83 alias mc="mc --nomouse"
86 # find . -name "*$1*" -print
90 alias ssh="TERM=xterm ssh"
91 alias sshnm="ssh -S none"
93 ssh -C -t $1 tmux attach -t0
104 bindkey "
\eOQ" cddotdot # F2
111 bindkey "
\eOS" popdquiet # F4
116 alias Gb="git branch"
117 alias Gc="git checkout"
119 alias Gdc="git diff --cached"
120 alias Gs="git show --show-signature"
121 alias Gm="git diff --name-only --diff-filter=M"
122 alias Gam="git commit --amend"
123 alias Gl="git log --oneline --graph --decorate=short"
124 alias Gld="git log --format=format:'%ai %Cgreen%h%Creset %s'"
126 bindkey -s "
\eOR" " git status --short\n" # F3
134 --dereference-recursive
135 --binary-files=without-match
139 LESS_COLOURED=(less --RAW-CONTROL-CHARS)
141 grep $GREP_ARGS $@ | $LESS_COLOURED
144 grep $GREP_ARGS $@ | sort --numeric-sort | $LESS_COLOURED
146 alias -g G="| grep --colour=always"
151 export GPG_TTY=$(tty)
156 ~/mail/mbox"?Neue Nachrichten in =mbox"
157 ~/mail/arbeit"?Neue Nachrichten in =arbeit"
159 alias arr="mutt -f \=arbeit -e 'source ~/.mutt/accounts/stcnet.ru'"
160 alias sent="mutt -f =sent-\`date '+%y-%m'\`"
161 bindkey -s "
\eOP" " inc\n" # F1
165 zstyle ":completion:*:functions" ignored-patterns "_*"
166 zstyle ":completion:*" matcher-list "" 'm:{a-z\-}={A-Z\_}' 'r:|?=** m:{a-z\-}={A-Z\_}'
168 [[ ${words[1]} != man ]] || { _man && return 0 }
169 [[ $CURRENT -eq 1 ]] && _command_names || _files && return 0
170 # MAGIC_EQUAL_SUBST {{{
171 [[ $PREFIX = *\=* ]] || return 1
172 compstate[parameter]=${PREFIX%%\=*}
177 zstyle ":completion:*" completer _mycomp _parameters
178 autoload -U compinit ; compinit -d /tmp/.zcompdump
179 zstyle ":completion:*:default" list-colors ""
184 ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
185 . ~/work/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
186 typeset -A ZSH_HIGHLIGHT_STYLES
187 ZSH_HIGHLIGHT_STYLES[assign]="fg=yellow"
188 ZSH_HIGHLIGHT_STYLES[commandseparator]="fg=red"
189 ZSH_HIGHLIGHT_STYLES[single-hyphen-option]="fg=green,bold"
190 ZSH_HIGHLIGHT_STYLES[double-hyphen-option]="fg=green"
191 ZSH_HIGHLIGHT_STYLES[globbing]="fg=magenta"
192 ZSH_HIGHLIGHT_STYLES[global-alias]="fg=yellow,bold"
193 ZSH_HIGHLIGHT_STYLES[history-expansion]="fg=magenta"
194 ZSH_HIGHLIGHT_STYLES[redirection]="fg=red"
195 ZSH_HIGHLIGHT_STYLES[path]="fg=white,underline"
196 ZSH_HIGHLIGHT_STYLES[path_pathseparator]="fg=white,bold,underline"
200 . ~/work/zsh-autosuggestions/zsh-autosuggestions.zsh
201 ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=cyan"
206 local dir=$(find -L ${1:-.} -mindepth 1 -path "*/\.git" -prune -o -type d -print |
207 fzf --height 40% --reverse --preview="tree -CN {}")
208 [[ -z $dir ]] || { print -s cd $dir ; cd $dir }
212 # Named directories {{{
215 hash -d ${w[1]}=${~${w[2]}}
220 . ~/work/zsh-autoenv/autoenv.zsh
225 . /usr/local/bin/virtualenvwrapper.sh