Backspace handling changed.

As it is problematic to get the correct char for backspace and C-Backspace
based on $TERM, especially when mosh, tmux and urxvt are combined, the config
now assumes Backspace as ^? and C-Bksp as ^H. If a terminal has these swapped
(e.g. xterm), change it according to your needs.
This commit is contained in:
Alexander Gehrke 2013-03-22 13:41:39 +01:00
parent 7b37c88ea5
commit 40c44cf088
2 changed files with 5 additions and 12 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
aliases/local aliases/local
aliases/private_functions
*.zwc *.zwc
.zcompdump .zcompdump

View file

@ -17,28 +17,20 @@ bindkey "^[e" expand-cmd-path # C-e for expanding path of typed comman
bindkey "^[[A" up-line-or-search # Up arrow for back-history-search. 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 "^[[B" down-line-or-search # Down arrow for fwd-history-search.
bindkey " " magic-space # Do history expansion on space. bindkey " " magic-space # Do history expansion on space.
bindkey "" backward-delete-char #backspace
bindkey "" backward-delete-word #C-backspace
case "$TERM" in case "$TERM" in
*xterm*|(dt|k)term) *xterm*|(dt|k)term)
bindkey "" backward-delete-char #backspace bindkey "" beginning-of-line # Pos1
bindkey "" backward-delete-word #C-backspace bindkey "" end-of-line # End
bindkey "OH" beginning-of-line # Pos1
bindkey "OF" end-of-line # End
bindkey "^[[7~" beginning-of-line # Pos1
bindkey "^[[8~" end-of-line # End
;; ;;
rxvt*|Eterm) rxvt*|Eterm)
bindkey "^[[7~" beginning-of-line # Pos1 bindkey "^[[7~" beginning-of-line # Pos1
bindkey "^[[8~" end-of-line # End bindkey "^[[8~" end-of-line # End
bindkey "" backward-delete-char #backspace
bindkey "" backward-delete-word #C-backspace
;; ;;
linux|screen*) linux|screen*)
bindkey "[1~" beginning-of-line # Pos1 bindkey "[1~" beginning-of-line # Pos1
bindkey "[4~" end-of-line # End bindkey "[4~" end-of-line # End
bindkey "OD" vi-backward-blank-word
bindkey "OC" vi-forward-blank-word
bindkey "" backward-delete-char #backspace
bindkey "" backward-delete-word #C-backspace
;; ;;
esac esac
bindkey "OA" up-line-or-history bindkey "OA" up-line-or-history