在 tmux/cygwin 下的 vim 中设置默认颜色主题与外部 tmux 相同

Set default color theme in vim under tmux/cygwin the same as outside tmux

我在 Cygwin 上使用 tmux。当我在 Cygwin(没有 tmux)中打开 vim 时,以 # 开头的注释看起来不错: enter image description here

但是我在tmux下打开vim同样的评论看起来很难看: enter image description here

我的 .bashrc.vimrc 文件是空的,默认设置。

.tmux.conf只包含一些简单的命令:

#Change default prefix key
unbind-key C-b
set -g prefix 'C-\'
bind-key 'C-\' send-prefix

#Increase history limits
set-option -g history-limit 99999

#Start windows at 1, not 0
set -g base-index 1
setw -g pane-base-index 1

#Highlight border of active split pane with blue
set-option -g pane-active-border-fg blue

#Setting 256 colors globally in tmux
set -g default-terminal "screen-256color"

#Colors of windows names
set-window-option -g window-status-current-fg colour33 #orange
set-window-option -g window-status-current-bg default
set-window-option -g window-status-current-attr bright

#Color of the task bar
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default

如何设置 vim 中的颜色以在 tmux 下看起来与在 tmux 外看起来一样?

我找到了答案的解决方案。此设置:set background=dark 使 vim 中的注释在 tmux 内部和外部看起来相同。在 Cygwin 和 Ubuntu.

中测试