![]() ![]() The only drawback is if I ever change my desktop theme from a dark flavor to a light flavor, Vim won't automatically switch to the "default" light theme color scheme, which is apparently peachpuff. Now, whether I start Vim inside or outside of tmux, the colors appear the same. I ended up doing what did in his answer and explicitly set colorscheme ron in my ~/.vimrc file. I came across it while searching before I posted this question, but, for some reason, the color scheme didn't strike me as being relevant. I also found another question that seems to describe the same problem I'm having. (Even though this post is with respect to Ubuntu, I'm assuming the OP was using GNOME.) As the answer points out, a dark theme (which I am using) corresponds to the ron color scheme, just as I discovered above. I found an Ask Ubuntu answer that suggests that when Vim reports it is using the default color scheme, it doesn't necessarily mean default.vim but rather some theme-specific color scheme. To get the colors back to what they were when I first start Vim, I had to use the ron color scheme. ![]() If I explicitly set the color scheme using :colorscheme default when TERM=xterm-256color, Vim's appearance changes to that when TERM=screen-256color. I thought that odd because the default color scheme on Fedora 25 ( /usr/share/vim/vim80/colors/default.vim) doesn't appear to match the colors I actually see when TERM=xterm-256color. Vim reports it is using the default color scheme in both cases. Thanks to analysis of what colors Vim was outputting when TERM=screen-256color, I was inspired to look at the color scheme Vim is using in the two scenarios. In all cases, Vim continued to display different colors inside of tmux. Set -g default-terminal "screen.xterm-256color" Set -g default-terminal "screen-256color" Explicitly setting the default terminal tmux uses in ~/.nf to various values (some against the advice of the tmux FAQ):.Independent of the previous question, is it possible to have the Vim colors be consistent when running inside or outside of tmux? Some things I've tried include: Which leads to the question posed in the title: what specifically in the terminal capabilities causes the Vim colors to be different? I see the differences between running :set termcap inside and outside of tmux, but I'm curious as to which variables actually cause the difference in behavior. So that makes me believe there's simply some difference between the xterm-256color and screen-256color terminal capabilities that causes the difference in color. I can duplicate the problem outside of tmux if I run Vim with the terminal type set to screen-256color: $ TERM=screen-256color vim There are many similar questions out there regarding getting Vim to run in 256-color mode inside tmux (the best answer I found is here), but I don't think that's my problem given the above information. Vim also reports both instances are running in 256-color mode (via :set t_Co?): Vim reports these terminal types as expected (via :set term?): Below are screenshots of Vim outside (left) and inside (right) of tmux while viewing a Git diff: I recently started using tmux and have observed that the colors within Vim change depending on whether I'm running inside or outside of tmux. GNOME Terminal 3.22.1 Using VTE version 0.46.1 +GNUTLS. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |