Code Monkey home page Code Monkey logo

Comments (7)

edkolev avatar edkolev commented on July 29, 2024

tmux's statusline colors are messed up because for some reason vim's statusline colors are messed up. The question is: why are vim's statusline colors messy?

A wild guess: your $TERM is not recognized by vim, because you start vim in the first pane with vim (which starts your brew-installed vim), but in the second pane you start vim with vi which starts OSX's pre-installed out-dated vim (which doesn't understand tmux's $TERM).

Could you try to reproduce vim's pinkish color outside of tmux?
Also, could you try removing the :silent! from this line https://github.com/Integralist/Fresh-Install/blob/master/Shell/vim/vundle.vim#L20 and then try to reproduce. Hopefully this would give some error message

from tmuxline.vim.

Integralist avatar Integralist commented on July 29, 2024

@edkolev when I run :!which vim from within Vim (and inside Vim inside tmux) I can see /usr/bin/vim (system Vim) but doing which vim from outside Vim I see /usr/local/bin/vim which is what I expected/want.

I've just done cd /usr/bin/ && sudo mv vim vim-7.3 and now when I run :!which vim from inside either Vim or Vim inside tmux it correctly shows /usr/local/bin/vim but I still get that ugly pink theme.

That's after I removed the :silent! flag from my vim script (so looks like that doesn't produce any helpful errors)

from tmuxline.vim.

edkolev avatar edkolev commented on July 29, 2024

The pink theme is probably airline's tomorrow theme. Could you confirm this by running :AirlineTheme? (this will tell you which airline theme is active)

I suspect vim's colorscheme is incorrect (for some reason), hance airline's theme is incorrect (airline's tomorrow theme extracts its colors from vim's colorscheme), hence tmux's theme is incorrect (tmuxline extracts its colors from airline).

Is this reproducible if you start vim with its full path /usr/local/bin/vim?

from tmuxline.vim.

Integralist avatar Integralist commented on July 29, 2024

When I run the vim command outside of tmux and then :AirlineTheme I get tomorrow displayed.

That's the same when I run Vim from within tmux as well.

If I run Vim using the full path I get the exact same thing.

from tmuxline.vim.

edkolev avatar edkolev commented on July 29, 2024

So for some reason vim's colorscheme is incorrect. You can try different vim colorschemes, and different terminal emulators (iTerm2, Terminal.app), and maybe different multiplexers (tmux, screen) to pinpoint what's causing this misbehaviour.

Alternatively, you can create a .conf file for tmux and disable airline-tmuxline extension:

  1. start vim in tmux, make sure your colors are correct
  2. run :TmuxlineSnapshot ~/.tmuxline.conf to create a snapshot of the current tmux statusline colors
  3. set in tmux.conf source-file ~/.tmuxline.conf
  4. set in your vimrc let g:airline#extensions#tmuxline#enabled = 0 so vim doesn't set tmux's colors on startup

from tmuxline.vim.

Integralist avatar Integralist commented on July 29, 2024

One additional piece of information has come to light...

Running echo $TERM inside of tmux results in screen where as when run within Vim outside of tmux it results in xterm-256color

from tmuxline.vim.

Integralist avatar Integralist commented on July 29, 2024

Setting set -g default-terminal "screen-256color" within my tmux.conf did the trick

from tmuxline.vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.