0

I use the made of code theme. I was previously using macvim but switched to standard vim and am not seeing my normal syntax highlighting. Is there a way to get it to work?

I've confirmed that :colorscheme is madeofcode, as well as echo $g:colors_name. Thanks.

Eric M.
  • 5,399
  • 6
  • 41
  • 67

3 Answers3

1

then it is probably showing, but you might

  • not have defined ctermfg, ctermbg etc. (just guifg/guibg)
  • the terminal might not be capable of displaying all the colours

See also

16. Color xterms *xterm-color* *color-xterm*

Most color xterms have only eight colors.  If you don't get colors with the
default setup, it should work with these lines in your .vimrc: >
   :if &term =~ "xterm"
   :  if has("terminfo")
   :  set t_Co=8
   :  set t_Sf=<Esc>[3%p1%dm
   :  set t_Sb=<Esc>[4%p1%dm
   :  else
   :  set t_Co=8
   :  set t_Sf=<Esc>[3%dm
   :  set t_Sb=<Esc>[4%dm
   :  endif
   :endif
< [<Esc> is a real escape, type CTRL-V <Esc>]

You might want to change the first "if" to match the name of your terminal,
e.g. "dtterm" instead of "xterm".

Note: Do these settings BEFORE doing ":syntax on".  Otherwise the colors may
be wrong.

sehe
  • 374,641
  • 47
  • 450
  • 633
  • That gave me some colors, but still a very small subset. I'm not sure what my &term string would be (I'm running vim 7.3.3 on OS X Lion), so I just removed that condition. The rest is giving me a subset of colors. Any ideas? Thanks. – Eric M. Oct 31 '11 at 16:25
  • Or is this working correctly and the theme simply requires colors that are no longer available? – Eric M. Oct 31 '11 at 16:31
0

Type :echo &term to know your &term, try $ echo $TERM in Terminal.app too to see if it's the same, just in case.

The $TERM/&term you need is xterm-256color.

You either set it from Terminal.app's preferences or from within Vim, like in sehe's answer, or as an argument when actually lauching Vim: vim -T xterm-256color.

Beware, though, trying to use a different terminal type than the one declared by Terminal.app will most definetly mess up with lots of things including colour and keymaps.

romainl
  • 186,200
  • 21
  • 280
  • 313
0

Sorry, wrote up answer below before I noticed in a comment that you are on OS x. That's a different ball of wax, I think, I recall seeing fairly long SO thread on this issue for terminals on OS X. . . although this thread seems to indicate my solution works using iTerm: iterm vim colorscheme not working


This may also work, and is preferable to changing your terminal type. Just put the line below in your vimrc before any colorscheme command. Your xterm should support 256 colors, at least mine in Ubuntu does:

let &t_Co=256

That should fix the problem if the problem is xterm defaulting to too few colors, which you can confirm by doing :echo &t_Co in your terminal before applying fix above. If it's currently a number less than 256 then it should help.

I think the help section on color-xterm quoted in another answer must be old. My xterm on Ubuntu supports 256 as long as I do set t_Co=256 or equivalent let statement above, and Wikipedia indicates that xterm supports 256 colors:

http://en.wikipedia.org/wiki/Comparison_of_terminal_emulators

http://en.wikipedia.org/wiki/Xterm

Community
  • 1
  • 1
Herbert Sitz
  • 21,858
  • 9
  • 50
  • 54