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
14 setopt APPEND_HISTORY SHARE_HISTORY INC_APPEND_HISTORY HIST_IGNORE_ALL_DUPS
15 setopt HIST_IGNORE_SPACE
16 HISTORY_IGNORE="(yt* *|t *|t|mmfileget *|arr|rss)"
25 bindkey "^[[1~" beginning-of-line
26 bindkey "^[[4~" end-of-line
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 $(echo $BUFFER | sed "s/ /*/g")
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 autoload -U url-quote-magic
53 autoload -U bracketed-paste-magic
54 zle -N self-insert url-quote-magic
55 zle -N bracketed-paste bracketed-paste-magic
59 function zle-line-init zle-keymap-select {
60 mode_vi="${${KEYMAP/vicmd/+}/(main|viins)/-}"
61 [ $timer ] && timer_show=$(( $SECONDS - $timer ))
63 prompt+="%U${timer_show}%u|"
66 prompt+="%B%F{magenta}%#%f%b "
71 zle -N zle-keymap-select
78 printf "\a\033]2;\033\\"
85 alias ssh="TERM=xterm ssh"
91 alias mc="mc --nomouse"
94 # find . -name "*$1*" -print
99 ssh -C -t "$1" tmux attach -t0
101 alias sshnm="ssh -S none"
104 # Faster movement {{{
110 bindkey "
\eOS" pushdquiet # F4
117 bindkey "
\e[15~" cddotdot # F5
122 alias Gb="git branch"
123 alias Gc="git checkout"
126 alias Gm="git diff --name-only --diff-filter=M"
127 alias Gam="git commit --amend"
129 git_common="--oneline --abbrev-commit"
130 alias Gl="git log $git_common --graph --decorate=short"
131 alias Gr="git --no-pager log $git_common -n 20 | perl -ne 'print \"@~\$n \$_\"; \$n++'"
132 alias Grr="git --no-pager log $git_common --graph -n 1024 | vi -c 'setlocal filetype=gitrebase buftype=nofile noswapfile' -"
134 bindkey -s "
\eOQ" " git status\n" # F2
135 bindkey -s "
\eOR" " git status --short\n" # F3
139 GREP=/usr/local/bin/grep
140 GREP_ARGS="--color=always --with-filename --line-number --recursive"
141 LESS_COLORED="less --RAW-CONTROL-CHARS"
143 $GREP ${=GREP_ARGS} $@ | ${=LESS_COLORED}
146 $GREP ${=GREP_ARGS} $@ | sort --numeric-sort | ${=LESS_COLORED}
148 alias -g G="| $GREP --color"
159 . /usr/local/bin/virtualenvwrapper.sh
165 ~/mail/mbox"?Neue Nachrichten in =mbox"
166 ~/mail/arbeit"?Neue Nachrichten in =arbeit"
168 alias arr="mutt -f \=arbeit -e 'source ~/.mutt/accounts/stcnet.ru'"
169 alias rss="mutt -f \=rss"
170 bindkey -s "
\eOP" " inc\n" # F1
178 # Named directories {{{
183 zstyle ":completion:*:functions" ignored-patterns "_*"
184 zstyle ":completion:*" matcher-list "" 'm:{a-z\-}={A-Z\_}' 'r:|?=** m:{a-z\-}={A-Z\_}'
186 [ "$words[1]" != "man" ] || { _man && return 0 }
187 [ $CURRENT -eq 1 ] && _command_names || _files && return 0
188 # MAGIC_EQUAL_SUBST {{{
189 [[ "$PREFIX" = *\=* ]] || return 1
190 compstate[parameter]="${PREFIX%%\=*}"
195 zstyle ":completion:*" completer _mycomp _parameters
196 autoload -U compinit ; compinit -d /tmp/.zcompdump
197 zstyle ":completion:*:default" list-colors ""
202 ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
203 . ~/work/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
204 typeset -A ZSH_HIGHLIGHT_STYLES
205 ZSH_HIGHLIGHT_STYLES[assign]="fg=cyan"
206 ZSH_HIGHLIGHT_STYLES[commandseparator]="fg=red"
207 ZSH_HIGHLIGHT_STYLES[single-hyphen-option]="fg=green,bold"
208 ZSH_HIGHLIGHT_STYLES[double-hyphen-option]="fg=green"
209 ZSH_HIGHLIGHT_STYLES[globbing]="fg=magenta"
210 ZSH_HIGHLIGHT_STYLES[history-expansion]="fg=magenta"
211 ZSH_HIGHLIGHT_STYLES[redirection]="fg=red"
212 ZSH_HIGHLIGHT_STYLES[path]="fg=white,underline"
213 ZSH_HIGHLIGHT_STYLES[path_pathseparator]="fg=white,bold,underline"
217 . ~/work/zsh-autosuggestions/zsh-autosuggestions.zsh
218 ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=cyan"