4

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!

benichka
  • 925
  • 1
  • 11
  • 32
  • You can install git and make sure you select bash terminal during the installation. Or you can do a separate installation of MINGW 32 or 64 bit depending on your OS and you will get the right colorscheme. I have a windows 10 64 bit and i have git bash installed and vim works as expected. – Eskinder Aug 07 '17 at 21:00

4 Answers4

7

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.

resueman
  • 10,572
  • 10
  • 31
  • 45
2

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

Community
  • 1
  • 1
benichka
  • 925
  • 1
  • 11
  • 32
  • 1. You can try to change color in terminal settings. – Alex Kroll Mar 04 '15 at 08:35
  • 1
    2. You can try alternative terminals like ConEmu. ConEmu support 256 colors. 3. Last chance - Cygwin. My choice 2 and 3. – Alex Kroll Mar 04 '15 at 08:42
  • As for the colors in my terminal, well it's the command prompt from Windows so apparently I'm stuck with 16 colors anyway. But you are right for at least #2: I installed and configured ConEmu (there is a good topic there http://stackoverflow.com/questions/14315519/conemu-vim-syntax-highlight/14434531#14434531), and it works like a charm! Thank you :) – benichka Mar 04 '15 at 13:44
  • They have made improvements to the DOS prompt in Windows 10 to start [supporting 24-bit colours](https://blogs.msdn.microsoft.com/commandline/2016/09/22/24-bit-color-in-the-windows-console/), it actually requires some fixes now in regular Vim (as in not gVim) to handle the DOS colours. I made some [serious attempts to get Solarized colours working in the Vim](https://github.com/altercation/vim-colors-solarized/issues/141#issuecomment-302041296), but eventually gave up and switched to gVim. One thing that you also won't get in DOS anytime soon is italic and bold fonts. – icc97 Sep 23 '18 at 13:04
1

You can install git and make sure you select bash terminal during the installation. Or you can do a separate installation of MINGW 32 or 64 bit depending on your OS and you will get the right colorscheme. I have a windows 10 64 bit and i have git bash installed and the colorscheme works as expected. enter image description here

Eskinder
  • 1,369
  • 1
  • 14
  • 24
0

In windows to get those color schemes use gvim and disable the menu bar and title bar by adding following in vimrc

"Remove Menubar and Toolbar
set guioptions -=m 
set guioptions -=T

now it will look much like regular vim. on the bonus the windows resize better than default windows cmd.

user93
  • 1,866
  • 5
  • 26
  • 45