Improve 256color support for screen/vim
This commit is contained in:
@@ -155,11 +155,6 @@ alias su='su -m'
|
||||
# useful stuff
|
||||
[ -z "$VIM_ORIGINAL" ] && VIM_ORIGINAL="$(which vim)"
|
||||
function vim() {
|
||||
if [ "$TERM" = "linux" ]; then
|
||||
local COMPAT_TERM=$TERM
|
||||
else
|
||||
local COMPAT_TERM="xterm-256color"
|
||||
fi
|
||||
# we only handle single-argument VIM
|
||||
if [ $# -eq 1 ]; then
|
||||
if [ -e "$1" ]; then
|
||||
@@ -172,13 +167,13 @@ function vim() {
|
||||
|
||||
if [ -w "$FILENAME" ]; then
|
||||
# yahoo! writable
|
||||
TERM=$COMPAT_TERM "$VIM_ORIGINAL" "$1"
|
||||
"$VIM_ORIGINAL" "$1"
|
||||
else
|
||||
echo 'this file will be opened with sudo'
|
||||
TERM=$COMPAT_TERM sudo "$VIM_ORIGINAL" "$1" || "$VIM_ORIGINAL" "$1"
|
||||
sudo "$VIM_ORIGINAL" "$1" || "$VIM_ORIGINAL" "$1"
|
||||
fi
|
||||
else
|
||||
TERM=$COMPAT_TERM "$VIM_ORIGINAL" $*
|
||||
"$VIM_ORIGINAL" $*
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,8 @@ hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"
|
||||
# Launch login shells
|
||||
shell -${SHELL}
|
||||
# 256color support
|
||||
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
|
||||
#termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
|
||||
term screen-256color
|
||||
#defbce "on"
|
||||
# beep on activity monitor alert (C-a M)
|
||||
# ex.: 12:37 activity -> 7$ zsh
|
||||
|
||||
Reference in New Issue
Block a user