edkolev / tmuxline.vim

Simple tmux statusline generator with support for powerline symbols and statusline / airline / lightline integration
MIT License
1.61k stars 90 forks source link

True colors not supported #62

Open epilande opened 8 years ago

epilande commented 8 years ago

Tmux & Vim has true color support.

image

image

zacheryph commented 8 years ago

I can confirm. I had to :TmuxlineSnapshot without enabling termguicolors and hardcoding tmux to load this in order for it to show up properly. Doing set notermguicolors and attempting to re-run TmuxLine does not seem to fix this either. Once set termguicolors is done your done ;)

# NOTE: Powerline glyph removed
# Good Snapshot
set -g status-left "#[fg=colour193,bg=colour65] #S #[fg=colour65,bg=colour237,nobold,nounderscore,noitalics]"

# Bad Snapshot (set termguicolors)
set -g status-left "#[fg=,bg=] #S #[fg=,bg=,nobold,nounderscore,noitalics]"
zacheryph commented 8 years ago

FYI, here is my current hack. Yeah running vim at the beginning of every session takes a second or two but luckily this only happens once.

~/.vimrc

if empty($TMUX_SET_STATUSLINE)
  let g:airline#extensions#tmuxline#enabled = 0
  if has('termguicolors')
    set termguicolors
  endif
else
  let g:airline#extensions#tmuxline#enabled = 1
endif

~/.tmux.conf

run-shell '[ -d ~/.vim/plugged/tmuxline.vim ] && env TMUX_SET_STATUSLINE=1 vim -c "Tmuxline airline" -c "q"'
ErickChacon commented 7 years ago

With the following configuration on ~/.vimrc, the status line looks much better. You can choose vim_statusline_1, vim_statusline_2 or vim_statusline_3.

if exists('$TMUX')
    autocmd VimEnter * call tmuxline#set_statusline('vim_statusline_3')
endif

Taken from this link

Only works when working with vim, tmuxline changes when vim leaves the panel.

CPWeaver commented 7 years ago

FYI I found this fork which seems to work with true colors (at least for me):

https://github.com/weihanglo/tmuxline.vim

kevinkjt2000 commented 7 years ago

@CPWeaver Thanks for sharing! weihanglo's fork worked for me as well.

mlopezgva commented 5 years ago

It seems like weihanglo/tmuxline.vim is no longer available... Is it needed yet?

CPWeaver commented 5 years ago

I believe the termguicolors PR https://github.com/edkolev/tmuxline.vim/pull/93 fixed it. It is working great for me at least.