kevinjom
kevinjom

Reputation: 353

airline.vim does not work inside tmux

I am new to tmux and also not an expert on VIM, I tried to use tmux these days, but seems that airline disappeared when I used vim inside tmux. I would like to show you the screen shots and hopefully anyone can help me solve this problem.

airline in vim

airline inside tmux

Upvotes: 6

Views: 3124

Answers (4)

ton
ton

Reputation: 4607

In my case, using ubuntu 20.04 inside windows with WSL2, the accepted answer (export TERM=screen-256color), just freeze the tmux pane.

The fix for me was add to ~/.vim/vimrc:

set t_Co=256

Upvotes: 1

Jim-chriss Charles
Jim-chriss Charles

Reputation: 481

Add the following line in your .tmux.conf

set -g default-terminal screen-256color

Upvotes: 1

user3451822
user3451822

Reputation:

While the accepted answer works, it is not cheap. Manually setting the value of the $TERM variable will usually be set correctly by itself.

It is usually a good a idea to force tmux to assume the terminal supports 256 colors.

In your ~/.bash_aliases, add:

tmux='tmux -2'

Answer based on the following posts:

Upvotes: 3

Vitor
Vitor

Reputation: 1976

You need to correctly set $TERM environment variable to make vim properly detect 256 colors support by doing the following before opening vim:

export TERM=screen-256color

Upvotes: 8

Related Questions