airline.vim does not work inside tmux
Asked Answered
W

4

6

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

Wane answered 29/1, 2016 at 7:4 Comment(0)
C
8

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
Calebcaledonia answered 29/1, 2016 at 13:42 Comment(0)
B
3

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:

Bleed answered 17/10, 2017 at 13:28 Comment(0)
K
1

Add the following line in your .tmux.conf

set -g default-terminal screen-256color
Koph answered 4/6, 2019 at 5:21 Comment(0)
V
1

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
Valenza answered 29/6, 2021 at 13:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.