3 ### Zsh session things.
6 case ${INSIDE_EMACS+t},$TERM in t,dumb) unsetopt zle ;; esac
10 ###--------------------------------------------------------------------------
13 __mdw_set_prompt_hacks () {
15 linux*|screen*|xterm*|vt100*|eterm*)
17 gitcolour=%F{cyan} rccolour=%F{red} uncolour=%f
20 host=%m dir=" %(6~!%-1~/.../%5~!%~)"
24 __mdw_source_if_exists /usr/lib/git-core/git-sh-prompt
25 __mdw_set_prompt_pieces
26 precmd_functions+=(__mdw_precmd)
27 preexec_functions+=(__mdw_preexec)
30 ###--------------------------------------------------------------------------
36 forward-word backward-word kill-word backward-kill-word \
37 transpose-words capitalize-word up-case-word down-case-word \
38 delete-whole-word select-word
41 zle -N $w-bash $w-match
42 zle -N $w-shell $w-match
43 zstyle ':zle:*-bash' word-style standard
44 zstyle ':zle:*-bash' skip-whitespace-first true
45 zstyle ':zle:*-bash' word-chars ""
46 zstyle ':zle:*-shell' word-style shell
47 zstyle ':zle:*-shell' skip-whitespace-first false
50 bindkey "\eb" backward-word-bash
51 bindkey "\e^b" backward-word-shell
52 bindkey "\ef" forward-word-bash
53 bindkey "\e^f" forward-word-shell
54 bindkey "\e^?" backward-kill-word-bash
55 bindkey "^w" backward-kill-word-shell
56 bindkey "\ed" kill-word-bash
57 bindkey "\e^d" kill-word-shell
58 bindkey "\et" transpose-words-bash
59 bindkey "\e^t" transpose-words-shell
60 bindkey "\eu" up-case-word-bash
61 bindkey "\e^u" up-case-word-shell
62 bindkey "\el" up-case-word-bash
63 bindkey "\e^l" up-case-word-shell
64 bindkey "\ec" capitalize-word-bash
65 bindkey "\e^c" capitalize-word-shell
67 __mdw_delete_horizontal_space () {
68 LBUFFER=${LBUFFER%%[[:space:]]##}
69 RBUFFER=${RBUFFER##[[:space:]]##}
71 zle -N delete-horizontal-space __mdw_delete_horizontal_space
72 bindkey "\e\\" delete-horizontal-space
74 __mdw_just_one_space () {
75 LBUFFER="${LBUFFER%%[[:space:]]##} "
76 RBUFFER=${RBUFFER##[[:space:]]##}
78 zle -N just-one-space __mdw_just_one_space
79 bindkey "\e " just-one-space
82 ###--------------------------------------------------------------------------
85 ## Initialize the fancy completion machinery.
89 ## Contexts: :completion:FUNCTION:COMPLETER:COMMAND:ARGUMENT:TAG
90 zstyle ':completion:*' completer _expand _complete _ignored _approximate
91 zstyle ':completion:*' insert-unambiguous false
92 zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
93 zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
94 zstyle ':completion:*' matcher-list '' '+m:{[:lower:]}={[:upper:]} r:|[._-]=** r:|=**' '+l:|=* r:|=*'
95 zstyle ':completion:*' max-errors 0 numeric
96 zstyle ':completion:*' original true
97 zstyle ':completion:*' verbose false
98 zstyle ':completion:*:*:git*:*' verbose true
100 _r () { words[1]=sudo; _normal; }
104 ###--------------------------------------------------------------------------
105 ### Other shell tweaking.
107 HISTFILE=~/.zsh-history
114 unsetopt bash_auto_list
118 setopt list_ambiguous
121 unsetopt menu_complete
131 ###--------------------------------------------------------------------------
132 ### Finishing touches.
134 __mdw_source_if_exists "$HOME/.zshrc-local"
136 ###----- That's all, folks --------------------------------------------------