02.01.13

настройки для zsh под разными терминалами


case "${TERM}" in
linux)
     bindkey "^[[2~" yank
     bindkey "^[[3~" delete-char
     bindkey "^[[5~" up-line-or-history
     bindkey "^[[6~" down-line-or-history
     bindkey "^[[1~" beginning-of-line
     bindkey "^[[4~" end-of-line
     bindkey "^[e" expand-cmd-path ## C-e for expanding path of typed command
     bindkey "^[[A" up-line-or-search ## up arrow for back-history-search
     bindkey "^[[B" down-line-or-search ## down arrow for fwd-history-search
     bindkey " " magic-space ## do history expansion on space
;;

cons*)
     bindkey "^[[H" beginning-of-line
     bindkey "^[[F" end-of-line
     bindkey "^?" delete-char
     bindkey "^[[2~" overwrite-mode
   
     bindkey "^[[5~" up-line-or-history
     bindkey "^[[6~" down-line-or-history
     bindkey "^[[A" up-line-or-search ## up arrow for back-history-search
     bindkey "^[[B" down-line-or-search ## down arrow for fwd-history-search
     bindkey " " magic-space ## do history expansion on space
     bindkey "^[e" expand-cmd-path ## C-e for expanding path of typed command
;;

xterm*)
     bindkey "^[OH" beginning-of-line
     bindkey "^[OF" end-of-line
     bindkey "^[[3~" delete-char
     bindkey "^[[2~" overwrite-mode
   
     bindkey "^[[5~" up-line-or-history
     bindkey "^[[6~" down-line-or-history
     bindkey "^[[A" up-line-or-search ## up arrow for back-history-search
     bindkey "^[[B" down-line-or-search ## down arrow for fwd-history-search
     bindkey " " magic-space ## do history expansion on space
     bindkey "^[e" expand-cmd-path ## C-e for expanding path of typed command
;;
   
rxvt)
     bindkey "^[[7~" beginning-of-line
     bindkey "^[[8~" end-of-line
     bindkey "^[[3~" delete-char
     bindkey "^[[2~" overwrite-mode
   
     bindkey "^[[5~" up-line-or-history
     bindkey "^[[6~" down-line-or-history
     bindkey "^[[A" up-line-or-search ## up arrow for back-history-search
     bindkey "^[[B" down-line-or-search ## down arrow for fwd-history-search
     bindkey " " magic-space ## do history expansion on space
     bindkey "^[e" expand-cmd-path ## C-e for expanding path of typed command
;;
screen*)
     bindkey "^[[1~" beginning-of-line
     bindkey "^[[4~" end-of-line
     bindkey "^[[3~" delete-char
     bindkey "^[[2~" overwrite-mode
   
     bindkey "^[[5~" up-line-or-history
     bindkey "^[[6~" down-line-or-history
     bindkey "^[[A" up-line-or-search ## up arrow for back-history-search
     bindkey "^[[B" down-line-or-search ## down arrow for fwd-history-search
     bindkey " " magic-space ## do history expansion on space
     bindkey "^[e" expand-cmd-path ## C-e for expanding path of typed command
;;

esac