1 # vim: foldmethod=marker:foldlevel=0
4 setopt APPEND_HISTORY SHARE_HISTORY INC_APPEND_HISTORY HIST_IGNORE_ALL_DUPS
5 setopt HIST_IGNORE_SPACE
6 setopt INTERACTIVE_COMMENTS
7 setopt GLOB_STAR_SHORT GLOB_DOTS EXTENDED_GLOB
9 setopt AUTO_PUSHD PUSHD_IGNORE_DUPS
21 bindkey "^[[1~" beginning-of-line
22 bindkey "^[[4~" end-of-line
25 # Command-line editing {{{
26 autoload -U edit-command-line
27 zle -N edit-command-line
28 bindkey -M vicmd v edit-command-line
32 autoload -U history-search-end
33 zle -N history-beginning-search-backward-end history-search-end
34 zle -N history-beginning-search-forward-end history-search-end
35 bindkey "^[[A" history-beginning-search-backward-end
36 bindkey "^[[B" history-beginning-search-forward-end
37 bindkey "^R" history-incremental-pattern-search-backward
41 function zle-line-init zle-keymap-select {
42 mode_vi="${${KEYMAP/vicmd/+}/(main|viins)/-}"
43 [ $timer ] && timer_show=$(( $SECONDS - $timer ))
45 prompt+="%U${timer_show}%u|"
48 prompt+="%F{magenta}%#%f "
53 zle -N zle-keymap-select
60 printf "\a\033]2;\033\\"
67 alias ssh="TERM=xterm ssh"
72 alias mc="mc --nomouse"
73 bindkey -s "
\eOS" " popd\n" # F4
76 # find . -name "*$1*" -print
81 ssh -C -t "$1" tmux attach -t0
83 alias sshnm='ssh -S none'
89 alias Gc="git checkout"
92 alias Gm="git diff --name-only --diff-filter=M"
93 alias Gam="git commit --amend"
96 git_common="--oneline --abbrev-commit"
97 alias Gl="git log $git_common --graph --decorate=short"
98 alias Gr="git --no-pager log $git_common -n 20 | perl -ne 'print \"@~\$n \$_\"; \$n++'"
99 alias Grr="git --no-pager log $git_common --graph -n 1024 | vi -c 'e ++enc=utf8' -"
100 alias Grpck="git gc --prune=now ; git repack -a -d --depth=4095 --window=10240"
102 bindkey -s "
\eOQ" " git status\n" # F2
103 bindkey -s "
\eOR" " git status --short\n" # F3
107 GREP=/usr/local/bin/grep
108 GREP_ARGS="--color=always --with-filename --line-number --recursive"
109 LESS_COLORED="less --RAW-CONTROL-CHARS"
111 $GREP ${=GREP_ARGS} $@ | ${=LESS_COLORED}
114 $GREP ${=GREP_ARGS} $@ | sort --numeric-sort | ${=LESS_COLORED}
116 alias -g G="| $GREP --color"
127 . /usr/local/bin/virtualenvwrapper.sh
133 ~/mail/mbox"?Neue Nachrichten in =mbox"
134 ~/mail/arbeit"?Neue Nachrichten in =arbeit"
136 alias arr="mutt -f =arbeit -e 'source ~/.mutt/accounts/stcnet.ru'"
137 alias rss="mutt -f =rss"
138 bindkey -s "
\eOP" " inc\n" # F1
148 zstyle ":completion:*:functions" ignored-patterns "_*"
149 zstyle ":completion:*" matcher-list "" 'm:{a-z\-}={A-Z\_}' 'r:|?=** m:{a-z\-}={A-Z\_}'
151 [ $CURRENT -eq 1 ] && _command_names || _files && return 0
152 # MAGIC_EQUAL_SUBST {{{
153 [[ "$PREFIX" = *\=* ]] || return 1
154 compstate[parameter]="${PREFIX%%\=*}"
159 zstyle ":completion:*" completer _mycomp _parameters
160 autoload -U compinit ; compinit -d /tmp/.zcompdump
161 zstyle ":completion:*:default" list-colors ""
166 ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
167 . ~/work/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
168 typeset -A ZSH_HIGHLIGHT_STYLES
169 ZSH_HIGHLIGHT_STYLES[globbing]="fg=magenta"
170 ZSH_HIGHLIGHT_STYLES[history-expansion]="fg=magenta"
171 ZSH_HIGHLIGHT_STYLES[commandseparator]="fg=red"
172 ZSH_HIGHLIGHT_STYLES[redirection]="fg=red"
173 ZSH_HIGHLIGHT_STYLES[assign]="fg=cyan"
177 . ~/work/zsh-autosuggestions/zsh-autosuggestions.zsh
178 ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=6"