2

I have referred to this question and I tried many of the changes suggested and it worked for a moment. I updated my Ubuntu machine to latest version and it broke my tmux. lose vim colorscheme in tmux mode

Currently everything works perfectly outside of tmux but the vim in tmux is having problems.

My vimrc :

call plug#begin('~/.vim/plugged')
Plug 'arcticicestudio/nord-vim'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
call plug#end()

set termguicolors
set hlsearch
syntax on
colorscheme nord

I have set these 2 variables in my bashrc

export TERM="xterm-256color"
alias tmux='tmux -2'

One ans suggested to add this set -g default-terminal "xterm" in tmux.conf but adding this loses all the colors in my tmux.

I am using this https://github.com/lemnos/theme.sh for setting colorscheme of my terminal.

I don't understand what I'm doing wrong.

V3nomXP
  • 25
  • 2
  • 4

1 Answers1

9

I recently had this problem myself. When comparing your config files to mine, I have a few more lines than you.

tmux.conf:

set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*256col*:Tc"

vimrc

set term=xterm-256color
Feqzz
  • 106
  • 1
  • 2
  • 1
    After a long search, this was the option that worked for me. I didn't set the vimrc part though. Just the tmux.conf you pasted made it work on my side. Thanks! – raphaklaus Jul 16 '22 at 14:04
  • I was having the same problem - using the KDE Konsole on Pop_OS Linux. I tried several options - but the combination of the two lines of code above for my tmux config solved it for me. I also omitted the line for vimrc - since I have mine configured for `termguicolors`. – jwDavis May 04 '23 at 06:01
  • This did the trick for me as well. for LazyVim/neovim+ tmux. In particular I only had the 2nd line on tmux.conf – Paschalis Aug 18 '23 at 07:26
  • thanks for your solution after spending lots of time on internet – Hoang Do Aug 29 '23 at 09:14