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.
Asked
Active
Viewed 2,860 times
4 Answers
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

Vitor
- 1,936
- 12
- 20
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:
1
Add the following line in your .tmux.conf
set -g default-terminal screen-256color

Jim-chriss Charles
- 441
- 4
- 3
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

ton
- 3,827
- 1
- 42
- 40