chiark / gitweb /
dot/zshrc: Export the temporary directory as `~t'.
[profile] / dot / zshrc
index d280c14f662c4ff86cd91852f0659f1bfd5e8d18..34ddcf58c2fb4b9b61660bf655d6027d06b6b6db 100644 (file)
--- a/dot/zshrc
+++ b/dot/zshrc
@@ -17,7 +17,8 @@ __mdw_set_prompt_hacks () {
       gitcolour=%F{cyan} rccolour=%F{red} uncolour=%f
       ;;
   esac
-  host=%m dir=" %(6~!%-1~/.../%5~!%~)"
+  host=%m dir=" %(6~!%-1~/.../%4~!%~)"
+  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 \
@@ -64,6 +67,20 @@ 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
 
@@ -115,29 +132,31 @@ SAVEHIST=1000
 
 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 ksh_glob
+setopt hist_ignore_space
+unsetopt ksh_glob
 setopt list_ambiguous
 setopt list_packed
+setopt multios
 unsetopt nomatch
 unsetopt menu_complete
 setopt notify
+setopt rc_expand_param
 setopt share_history
 
-zshaddhistory () {
-  case "$1" in
-    " "*) return 2 ;;
-    *) return 0 ;;
-  esac
-}
+hash -d t=$TMPDIR
 
 ###--------------------------------------------------------------------------
 ### Finishing touches.
 
+## Local tweaks.
 __mdw_source_if_exists "$HOME/.zshrc-local"
 
 ###----- That's all, folks --------------------------------------------------