Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use true colors in vim under tmux? #1246

Closed
rinetd opened this issue Jan 27, 2018 · 5 comments
Closed

How to use true colors in vim under tmux? #1246

rinetd opened this issue Jan 27, 2018 · 5 comments

Comments

@rinetd
Copy link

rinetd commented Jan 27, 2018

  1. Edit .tmux.conf
# !!!importent!!! 开启24 bit color 其他方式都无效
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*256col*:Tc"
  1. Edit: .vimrc
" Enable true color 启用终端24位色
if exists('+termguicolors')
  let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
  let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
  set termguicolors
endif
@rinetd rinetd closed this as completed Jan 27, 2018
@albertux
Copy link

Thank you

@elquimista
Copy link

For me, it was screen-256color. My tmux complains it can't recognize tmux-256color. Other than that, it's all good. Thanks!

@gzxultra
Copy link

for anyone tried this trick but still not working, noted that tmux 2.6 or higher is required.

@utrumo
Copy link

utrumo commented May 17, 2019

Thank you!
For me on ubuntu 19.04, tmux 2.8 and nvim v0.4.0-dev it was:

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

.vimrc:
if (has("termguicolors"))
  set termguicolors
endif

ernestre added a commit to ernestre/dotfiles that referenced this issue Jul 21, 2019
jaydorsey added a commit to jaydorsey/dotfiles that referenced this issue Aug 13, 2019
elentok added a commit to elentok/dotfiles that referenced this issue Aug 23, 2019
naopontan added a commit to naopontan/dotfiles that referenced this issue Dec 28, 2019
mjansing added a commit to mjansing/dotfiles that referenced this issue Feb 5, 2020
dailyherold added a commit to dailyherold/dotfiles that referenced this issue Feb 7, 2020
- Enable truecolor in tmux
- Replace vim solarized theme with truecolor compatible theme
  (solarized8)
- Added needed vim config for truecolor support
- No more F5 shortcut for toggling background (came from old solarized
  theme) but can just :set bg=dark|light to quickly change manually

References:
- tmux/tmux#1246
- vim/vim#993 (comment)
- https://gist.github.com/XVilka/8346728
@lock
Copy link

lock bot commented Feb 14, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Feb 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

5 participants