← Back to list

Vim colors inside a tmux session

I tried several ways which returned by Google, but don’t get what I expected.

Xuta Le · 2020-03-19 15:46 · 2 claps · 0.6 min read
#vim #tmux #xterm #screen-256color
Open on Medium ↗

Vim colors inside a tmux session

I tried several ways which returned by Google, but don’t get what I expected.

Here are couple outcomes I infered after all

  1. No, you can’t get same colors in vim inside/outside of tmux with xterm-256color .
  2. Vim with xterm-256color outside of tmux is the best. Second prize and very close to the champion is Vim with screen-256color, still feel differences, but not much.
  3. Vim with screen-256color inside or outside of tmux are the same or almost the same. Sometimes I think I found a difference, but then sometimes not. Not 100% sure.
  4. The best choice to have both Vim and Tmux is
export TERM=screen-256color

In .tmux.conf

set -g terminal-overrides 'xterm*:smcup@:rmcup@'
set -g default-terminal 'screen-256color'

You will need to make sure that your terminal application supports truecolor.

Check it by

$ echo $COLORTERM
truecolor

:wq


메타데이터
post_id
6cfc5a53cd66
slug
vim-colors-inside-a-tmux-session-6cfc5a53cd66
url
https://medium.com/@xuta/vim-colors-inside-a-tmux-session-6cfc5a53cd66
canonical_url
https://medium.com/@xuta/vim-colors-inside-a-tmux-session-6cfc5a53cd66
author_url
https://medium.com/@xuta
status
ok
fetched_at
2026-07-29 05:38:16