From 1b67396957fc2337d4417c551349a922e5d6369a Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Sun, 30 Nov 2008 22:01:57 -0600 Subject: [PATCH 1/2] various changes of various flavors --- Xresources | 3 +++ vimrc | 16 ++++++++-------- zshrc | 24 ++++++++++++++++++------ 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/Xresources b/Xresources index 5f4566d..c7557d7 100644 --- a/Xresources +++ b/Xresources @@ -88,3 +88,6 @@ URxvt*color12: #729FCF URxvt*color13: #AD7FA8 URxvt*color14: #34E2E2 URxvt*color15: #EEEEEC + +/* Rxvt */ +Rxvt*termName: rxvt diff --git a/vimrc b/vimrc index 2e5b7c7..04c3a7f 100644 --- a/vimrc +++ b/vimrc @@ -274,18 +274,18 @@ imap :silent set number! " Don't force column 0 for # inoremap # X# -" Force to be backspace except when in interix mode -" because interix uses that for forward delete... -" and always accept as a backspace key -" Let interix use ^[[U for end and ^[[H for home +" Always map to backspace +" Both interix and cons use C-? as forward delete, +" besides those two exceptions, always set it to backspace +" Also let interix use ^[[U for end and ^[[H for home map map! -if (&term !~ "interix") - map - map! -else +if (&term =~ "interix") map  map  +elseif (&term !~ "cons") + map + map! endif " Python specific stuff diff --git a/zshrc b/zshrc index a2b3659..82b1ba5 100644 --- a/zshrc +++ b/zshrc @@ -86,19 +86,25 @@ export LESS=' -R' # aliases alias cd..='cd ..' +# handles per OS aliases, fixes a few terms case `uname -s` in Linux|CYGWIN*) alias ls="ls -h --color=auto" alias grep='grep -d skip --color=auto' ;; FreeBSD|Darwin|DragonFly) - # we must lie to the mac, for it is dumb export LSCOLORS=ExGxFxDxCxDxDxHbaDacec alias ls="ls -Gh" alias grep='grep -d skip --color=auto' ;; Interix) alias ls="ls --color" + + # sorta hacky, but I cannot find a better way to do this :/ + if [[ `which infocmp` = /usr/local/bin/infocmp ]] ; then + export TERMINFO=/usr/local/share/terminfo + export TERM=$TERM + fi ;; SunOS) if (which gls &> /dev/null) ; then @@ -169,6 +175,10 @@ case $TERM in bindkey '^[[5D' emacs-backward-word bindkey '^[OC' emacs-forward-word bindkey '^[OD' emacs-backward-word + bindkey '^[Oc' emacs-forward-word + bindkey '^[Od' emacs-backward-word + bindkey '^[[c' emacs-forward-word + bindkey '^[[d' emacs-backward-word ;; linux) bindkey '^[[1~' beginning-of-line @@ -184,11 +194,17 @@ case $TERM in bindkey '^[[7~' beginning-of-line bindkey '^[[8~' end-of-line ;; + cons*) + bindkey '^[[H' beginning-of-line + bindkey '^[[F' end-of-line + bindkey '^?' delete-char + ;; interix) bindkey '^[[H' beginning-of-line bindkey '^[[U' end-of-line + bindkey '^?' delete-char ;; - cygwin) + cygwin*) bindkey '^[[1~' beginning-of-line bindkey '^[[4~' end-of-line ;; @@ -208,9 +224,6 @@ precmd() { local termtitle - ## Changing IFS breaks a few things otherwise, especially clear-zle-screen - IFS=$' \t\n' - termtitle=$(print -P "%n@%m") title zsh "$termtitle" } @@ -267,7 +280,6 @@ function title # Use these two for GNU Screen: print -nR $'\ek'$1$'\e'"\\" shift -# print -nR $'\e]0;'$*$'\a' print -nR $'\e_screen \005 | '$*$'\e'"\\" ;; xterm*|rxvt*|cygwin|interix) From 4c7d42336bc1d37a11f7379721374c5a22c46f67 Mon Sep 17 00:00:00 2001 From: dave Date: Tue, 2 Dec 2008 20:29:57 -0600 Subject: [PATCH 2/2] updated keybindings style --- zshrc | 62 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/zshrc b/zshrc index d8d07d5..4c21885 100644 --- a/zshrc +++ b/zshrc @@ -151,48 +151,48 @@ bindkey ' ' magic-space bindkey -M emacs '\ee' edit-command-line -bindkey -M emacs '' history-incremental-search-forward -bindkey -M emacs '' history-incremental-search-backward +bindkey -M emacs '^P' history-incremental-search-forward +bindkey -M emacs '^N' history-incremental-search-backward case $TERM in xterm*) - bindkey '^[[H' beginning-of-line - bindkey '^[[F' end-of-line - bindkey '^[OH' beginning-of-line - bindkey '^[OF' end-of-line - bindkey '^[[1~' beginning-of-line - bindkey '^[[4~' end-of-line - bindkey '^[[7~' beginning-of-line - bindkey '^[[8~' end-of-line - bindkey '^[[3~' delete-char - bindkey '^[[1;5C' emacs-forward-word - bindkey '^[[1;5D' emacs-backward-word - bindkey '^[[5C' emacs-forward-word - bindkey '^[[5D' emacs-backward-word - bindkey '^[OC' emacs-forward-word - bindkey '^[OD' emacs-backward-word + bindkey '\e[H' beginning-of-line + bindkey '\e[F' end-of-line + bindkey '\eOH' beginning-of-line + bindkey '\eOF' end-of-line + bindkey '\e[1~' beginning-of-line + bindkey '\e[4~' end-of-line + bindkey '\e[7~' beginning-of-line + bindkey '\e[8~' end-of-line + bindkey '\e[3~' delete-char + bindkey '\e[1;5C' emacs-forward-word + bindkey '\e[1;5D' emacs-backward-word + bindkey '\e[5C' emacs-forward-word + bindkey '\e[5D' emacs-backward-word + bindkey '\eOC' emacs-forward-word + bindkey '\eOD' emacs-backward-word ;; linux) - bindkey '^[[1~' beginning-of-line - bindkey '^[[4~' end-of-line - bindkey '^[[3~' delete-char + bindkey '\e[1~' beginning-of-line + bindkey '\e[4~' end-of-line + bindkey '\e[3~' delete-char ;; rxvt*) - bindkey '^[[c' emacs-forward-word - bindkey '^[[d' emacs-backward-word - bindkey '^[Oc' emacs-forward-word - bindkey '^[Od' emacs-backward-word - bindkey '^[[3~' delete-char - bindkey '^[[7~' beginning-of-line - bindkey '^[[8~' end-of-line + bindkey '\e[c' emacs-forward-word + bindkey '\e[d' emacs-backward-word + bindkey '\eOc' emacs-forward-word + bindkey '\eOd' emacs-backward-word + bindkey '\e[3~' delete-char + bindkey '\e[7~' beginning-of-line + bindkey '\e[8~' end-of-line ;; interix) - bindkey '^[[H' beginning-of-line - bindkey '^[[U' end-of-line + bindkey '\e[H' beginning-of-line + bindkey '\e[U' end-of-line ;; cygwin) - bindkey '^[[1~' beginning-of-line - bindkey '^[[4~' end-of-line + bindkey '\e[1~' beginning-of-line + bindkey '\e[4~' end-of-line ;; esac