终端 (tmux) 中 vim 的默认颜色仍然与 gvim 的不匹配。我在基本操作系统 freya 中使用万神殿终端。这与日晒主题相结合:http: //ethanschoonover.com/solarized
当我在 tmux 中执行“echo $TERM”时,输出为:screen-256color
所以这似乎没问题。据我了解,$TERM 值必须在 .bashrc 中正确定义。Tmux 使用它而 vim 使用它在 tmux 中找到的 TERM 值?
在 GVIM 中,行号和注释是灰色的??我该如何改变这一点。其他颜色也不配?
我一直在寻找这个问题几个小时......
我的配置如下:
.bashr
# set a fancy prompt (non-color, unless we know we "want" color)
#case "$TERM" in
#xterm-color) color_prompt=yes;;
#esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
export EDITOR='vim'
### Start Tmux when opening terminal
if [[ ! $TERM =~ screen ]]; then
exec tmux -2
fi
.tmux.conf
# reload source file to enable settings
#$ tmux source-file ~/.tmux.conf
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
# Enable vi mode
set-window-option -g mode-keys vi
# Enable mouse control (clickable windows, panes, resizable panes)
set -g mouse-select-window on
set -g mouse-select-pane on
set -g mouse-resize-pane on
# switch panes using Alt-arrow without prefix
bind -n M-h select-pane -L
bind -n M-l select-pane -R
bind -n M-k select-pane -U
bind -n M-j select-pane -D
.vimrc
set background=dark
colorscheme solarized
使用万神殿时 $TERM = xterm
我还尝试了 vim csapprox 插件。这在很大程度上修复了它,但评论仍然不可读。