chiark / gitweb /
Merge remote-tracking branch 'staging'
[profile] / dot / zshrc
index e33255741bb6f9a22a9627ab8ee961343c6d6ac6..f6b205a0131995bb134575189648fecb26e241e5 100644 (file)
--- a/dot/zshrc
+++ b/dot/zshrc
@@ -18,6 +18,7 @@ __mdw_set_prompt_hacks () {
       ;;
   esac
   host=%m dir=" %(6~!%-1~/.../%5~!%~)"
+  more=%F{green}%_%f
 }
 
 if [ -t 0 ]; then
@@ -30,6 +31,8 @@ fi
 ###--------------------------------------------------------------------------
 ### Line editing.
 
+case $TERM in dumb) unsetopt zle ;; esac
+
 bindkey -e
 
 for w in \
@@ -59,11 +62,31 @@ bindkey "\et" transpose-words-bash
 bindkey "\e^t" transpose-words-shell
 bindkey "\eu" up-case-word-bash
 bindkey "\e^u" up-case-word-shell
-bindkey "\el" up-case-word-bash
-bindkey "\e^l" up-case-word-shell
+bindkey "\el" down-case-word-bash
+bindkey "\e^l" down-case-word-shell
 bindkey "\ec" capitalize-word-bash
 bindkey "\e^c" capitalize-word-shell
 
+bindkey "\e[1~" beginning-of-line "\e[4~" end-of-line
+
+bindkey -s           "\eOQ" "/" "\eOR" "*" "\eOS" "-"
+bindkey -s "\eOw" "7" "\eOx" "8" "\eOy" "9"
+bindkey -s "\eOt" "4" "\eOu" "5" "\eOv" "6" "\eOk" "+"
+bindkey -s "\eOq" "1" "\eOr" "2" "\eOs" "3"
+bindkey -s "\eOp" "0"           "\eOn" "."; bindkey "\eOM" accept-line
+
+bindkey -s           "\eOQ" "/" "\eOR" "*" "\eOS" "-"
+bindkey -s "\eOw" "7" "\eOx" "8" "\eOy" "9"
+bindkey -s "\eOt" "4" "\eOu" "5" "\eOv" "6" "\eOk" "+"
+bindkey -s "\eOq" "1" "\eOr" "2" "\eOs" "3"
+bindkey -s "\eOp" "0"           "\eOn" "."; bindkey "\eOM" accept-line
+
+bindkey "\ep" history-beginning-search-backward
+bindkey "\en" history-beginning-search-forward
+
+setopt interactive_comments
+bindkey "\e#" pound-insert
+
 __mdw_delete_horizontal_space () {
   LBUFFER=${LBUFFER%%[[:space:]]##}
   RBUFFER=${RBUFFER##[[:space:]]##}
@@ -78,14 +101,9 @@ __mdw_just_one_space () {
 zle -N just-one-space __mdw_just_one_space
 bindkey "\e " just-one-space
 
-
 ###--------------------------------------------------------------------------
 ### Completion.
 
-## Initialize the fancy completion machinery.
-autoload -Uz compinit
-compinit
-
 ## Contexts: :completion:FUNCTION:COMPLETER:COMMAND:ARGUMENT:TAG
 zstyle ':completion:*' completer _expand _complete _ignored _approximate
 zstyle ':completion:*' insert-unambiguous false
@@ -97,6 +115,10 @@ zstyle ':completion:*' original true
 zstyle ':completion:*' verbose false
 zstyle ':completion:*:*:git*:*' verbose true
 
+## Initialize the fancy completion machinery.
+autoload -Uz compinit
+compinit
+
 _r () { words[1]=sudo; _normal; }
 compdef _r rootly
 compdef _ssh @
@@ -108,29 +130,31 @@ HISTFILE=~/.zsh-history
 HISTSIZE=1000
 SAVEHIST=1000
 
-setopt appendhistory
 unsetopt auto_cd
 unsetopt auto_menu
+setopt bang_hist
 unsetopt bash_auto_list
 unsetopt beep
 setopt extendedglob
+unsetopt flow_control
+unsetopt global_export
+setopt glob_star_short
+setopt hist_ignore_all_dups
+setopt hist_ignore_space
 setopt ksh_glob
 setopt list_ambiguous
 setopt list_packed
+setopt multios
 unsetopt nomatch
 unsetopt menu_complete
 setopt notify
-
-zshaddhistory () {
-  case "$1" in
-    " "*) return 2 ;;
-    *) return 0 ;;
-  esac
-}
+setopt rc_expand_param
+setopt share_history
 
 ###--------------------------------------------------------------------------
 ### Finishing touches.
 
+## Local tweaks.
 __mdw_source_if_exists "$HOME/.zshrc-local"
 
 ###----- That's all, folks --------------------------------------------------