Having issues with colors in gui and cli macvim

75 views
Skip to first unread message

Ryan

unread,
Jan 24, 2011, 12:17:27 AM1/24/11
to vim_mac
I am relatively new to vim and am trying to get MacVim setup to use in
iTerm2. For some reason I'm having an issue with colors. In the gui
version of MacVim the colors look fine but when ran in the terminal
they come out looking bad as if the terminal can't support high
color. Here are the two side by side running the same theme.

https://skitch.com/ryandonahue/rk48y/fullscreen

Any ideas as to what I might be doing wrong?

Thanks,

Ryan

Nick Carter

unread,
Jan 24, 2011, 5:13:30 AM1/24/11
to vim...@googlegroups.com
Wasn't aware there was a terminal version... Is there?

Kyle Lippincott

unread,
Jan 24, 2011, 6:18:43 AM1/24/11
to vim...@googlegroups.com

Any number of things.. Your color scheme looks too good in terminal version, so I suspect it has special colors picked out for the terminal.  It may or may not switch these colors based on whether the terminal supports 256 colors.. 

A common problem is that the terminal is not recognized as supporting more than 8 colors.  What do you get if you type ":set t_Co?" 

> --
> You received this message from the "vim_mac" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

bojicas

unread,
Jan 24, 2011, 6:06:11 AM1/24/11
to vim_mac
I think that the vim shown in screenshot is the one which comes with
the operating system itself.

However, as an answer on the colors issue in iTerm2:

First, make sure that iTerm2 is configured to report terminal type as
xterm-256color (from iTerm -> Preferences -> Bookmarks tab ->
Terminal)

Screenshot: http://emberapp.com/bojicas/images/preferences/

Than, launch vim and do:

:set t_Co=256
:colorscheme xoria256

or any color scheme that supports 256 colors.

In order to make this settings load with vim, put following lines in
your .vimrc file:

if &term =~ "xterm-256color"
set t_Co=256
colorscheme xoria256
endif

Hope this helps,

Ryan

unread,
Jan 25, 2011, 8:53:45 AM1/25/11
to vim_mac
Well I was able to get it resolved. Even though I had xterm-256-color
setup in iTerm I was still seeing the problem. Once I put "set
t_Co=256" into my .zshrc file everything worked as it should. Thanks
guys.

-Ryan

Seth Milliken

unread,
Jan 26, 2011, 1:00:57 AM1/26/11
to vim_mac
If you symlink mvim to a name that doesn't already have a special
meaning (e.g. rvim, gvim, vimdiff, etc.), you can use the vim
distribution that is bundled in MacVim.app in the terminal.

I use cvim, myself (for "c[onsole] vim").

<code>
cd `which mvim`
ln -s mvim cvim
</code>
Reply all
Reply to author
Forward
0 new messages