Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim: colorscheme on MS Windows display wrong colors

I've been strugling with this topic the whole afternoon...

If I want to change the colorscheme of gvim, it's ok (here with the donbass.vim): gvim ok

but the same under vim, and the colors are not exact at all: vim ko

the content of my vimrc, well it's on the screenshots :D

I'm running Windows 7 and vim 7.4, but I also tried with Windows 8 without success...

Any idea what's wrong? Thank you!

like image 890
benichka Avatar asked Dec 24 '22 22:12

benichka


2 Answers

When you use command line Vim, it's restricted to the terminal's color palette. Command Prompt only supports 16 colors, which are unlikely to match the colorscheme very well. If you want it to look decent, you need to install a terminal which supports 256 colors.

like image 51
resueman Avatar answered Dec 28 '22 17:12

resueman


OK, resueman is right... Apparently on MS Windows it's almost useless to try to get 256 colors with vim (but it's OK with gvim).

I followed the directions from this link: http://vim.wikia.com/wiki/Xterm256_color_names_for_console_Vim

and then installed this plugin from here: http://www.vim.org/scripts/script.php?script_id=3412

the results with vim: vim only 16 colors so obviously, even if I set t_Co=256 in my vimrc, it doesn't work...

with gvim: gvim ok with 256 colors

I read this blog post where a user tried a lot of things running Windows, but quit in the end :D http://mx.kelsin.net/2014/02/17/installing-vim-and-a-sane-environment-in-windows/

So! If I want pretty themes / colors using vim under Windows, I'll stick to gvim!

Thanks for the hint resueman :)

Edit: another solution that works great (thank you Alex Kroll): use ConEmu and follow those directions: ConEmu: Vim Syntax Highlight

like image 22
benichka Avatar answered Dec 28 '22 18:12

benichka