MikeW
MikeW

Reputation: 4809

Lost colour scheme in TMUX when using Vim

I have a molokai colour scheme for vim which loads fine from shell. I've just installed tmux but have lost my colour settings. From reading other posts I found these settings for 256 mode but I must be missing a step. I'm on MacVim 7.3 and used brew for tmux

Here are my config settings

~/.tmux.conf

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

~/.bashrc

set -g default-terminal "xterm"

I ran

$ source ~/.bashrc

then either tmux or tmux -2 and I get the plain white screen when running vi. Any tips welcome

Cheers!

Upvotes: 0

Views: 1330

Answers (2)

Olivier Dulac
Olivier Dulac

Reputation: 3791

Try:

TERM="screen-256color" vim

or

TERM="xterm" vim

and see which one has colors, and use that in .bashrc.

Upvotes: 2

romainl
romainl

Reputation: 196751

set -g default-terminal "whatever" is a tmux command: it has nothing to do in ~/.bashrc.

set is a genuine command of your shell but it doesn't follow the same syntax and should spit an error upon initialization anyway.

  1. Remove that line from ~/.bashrc.

  2. Go to the prefs of your terminal emulator and set it to use xterm-256color.

Upvotes: 3

Related Questions