[answerback] add suppot to vim/term for putty

This commit is contained in:
David Alexander Majnemer 2010-10-27 16:20:46 -05:00
parent 16e96b6e19
commit 09a20db1f1
3 changed files with 18 additions and 4 deletions

View file

@ -66,8 +66,15 @@ if command -v infocmp >/dev/null 2>&1 ; then
;;
esac
if [ "${COLORTERM}" = "gnome-terminal" ]; then
TERM="xterm-256color"
if [ -n "${COLORTERM}" -o -n "${XTERM_VERSION}" -o -n "${TERM_PROGRAM}" ]; then
if [ "${COLORTERM}" = "gnome-terminal" ] ; then
TERM="xterm-256color"
fi
else
if command -v answerback >/dev/null 2>&1 ; then
ANSWERBACK=`answerback`
export ANSWERBACK
fi
fi
TERM=`fix_term $TERM`

View file

@ -84,6 +84,8 @@ my %links = (
'git-info' => 'bin/git-info',
'git-untrack-ignored' => 'bin/git-untracked-ignored',
answerback => 'bin/answerback',
gdbinit => '.gdbinit',
);
@ -94,6 +96,9 @@ if ($contained) {
($prefix) = $prefix =~ m{^\/? (.+) [^/]+ $}x;
}
`make answerback`;
warn "Could not compile answerback.\n" if ($? != 0);
my $i = 0; # Keep track of how many links we added
for my $file (keys %links) {
# See if this file resides in a directory, and create it if needed.

6
vimrc
View file

@ -7,8 +7,10 @@ if has('multi_byte') " Make sure we have unicode support
scriptencoding utf-8 " This file is in UTF-8
" ---- Terminal Setup ----
if (&termencoding == "" && (&term =~ "xterm" || &term =~ "putty")) || (&term =~ "rxvt-unicode") || (&term =~ "screen")
set termencoding=utf-8
if ($ANSWERBACK !=# "PuTTY")
if (&termencoding == "" && (&term =~ "xterm" || &term =~ "putty")) || (&term =~ "rxvt-unicode") || (&term =~ "screen")
set termencoding=utf-8
endif
endif
set encoding=utf-8 " Default encoding should always be UTF-8
endif