0

My vim is configured like so:

  syntax on
  colorscheme brogrammer
  set nu
  set expandtab
  set tabstop=4
  set autoindent

My tmux is configured like so:

set -g default-terminal "xterm-256color"

When I run vim in tmux I get the background color in the first and last rows in vim and on the borders. The grey is the background color of my vim theme and the blue is the background color of my terminal.

enter image description here

Any help would be much appreciated!

  • Probably the colorscheme is incomplete, as your vim configuration seems fine. Have you tried other colorschemes like molokai, wombat etc? Do they work fine? – Vlad Tarniceru Feb 27 '16 at 9:01
  • @VladTarniceru unfortunately the same thing happens with built in colorschemes – Carpetfizz Feb 27 '16 at 19:57
  • Have you tried another terminal? Does it work in the default terminal? – Vlad Tarniceru Feb 27 '16 at 20:32
  • I've only tried it in the default Terminal, which other one should I try? – Carpetfizz Feb 27 '16 at 20:35
  • Try molokai – Vlad Tarniceru Feb 29 '16 at 7:09
1

This fixed it for me as stated here:

https://stackoverflow.com/questions/6427650/vim-in-tmux-background-color-changes-when-paging#15095377

you need to put

if &term =~ '256color'
    " disable Background Color Erase (BCE) so that color schemes
    " render properly when inside 256-color tmux and GNU screen.
    " see also http://snk.tuxfamily.org/log/vim-256color-bce.html
    set t_ut=
endif

in your .vimrc.

0

Check the $TERM currently in use before running tmux.
echo $TERM

if needed adjust it TERM=xterm-256color then restart tmux.

if it's working define the TERM in your terminal settings to make it persistent.
Look for "Terminal type string" in Connection > data in the settings of your terminal (putty, kitty...)

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.