Search code examples
vimcygwin

How can I get proper vim themeing in Cygwin?


(edit: I am using zsh, if that matters)

I'm pretty baffled right now. Here's the relevant part of my vimrc (I'm using Vundle).

set t_Co=256
set background=dark
colorscheme PaperColor

(the full vimrc if you are curious, it's pretty short)

And here's what vim in Cygwin displays (with all Cygwin's terminal color stuff set to their out-of-box defaults): enter image description here

If I comment out the t_Co=256, I get this: enter image description here

Which is better, but not when you consider that the PaperColor theme is supposed to look like what's shown here.

I've read this answer here to a similar question, but that isn't a very good workaround for me -- I don't want to have to change Cygwin's terminal colors manually every time I change a color scheme, and would that even work if my vim uses one set of colors while my zsh uses another? Why can't Cygwin just display all the colors my monitor can -- does it really not have that ability? Or am I just messing something up with my configs? From what I've googled, the amount of information about how Cygwin colors work is surprisingly scarce. I expected hundreds of links with people having the exact same problem, but there's really only a few.


Solution

  • I found my problem.

    Long ago when I switched to zsh from bash, I altered my Cygwin launcher .bat file to launch zsh.exe. Doing so opens up a very stripped-down terminal running zsh, but it is NOT the mintty terminal, which Cygwin normally uses (and which supports much more features like better colors).

    I just had to switch my Cygwin launcher shortcut to open up the mintty terminal instead (and then login to zsh within Mintty).