2
votes

I recently started using vim-makegreen with mvim.

The issue is that the red/green bars do not work with mvim. They do work with mvim -v (or otherwise console vim).

After further investigation it appears that the highlight groups that are defined as:

hi GreenBar term=reverse ctermfg=white ctermbg=green guifg=white guibg=green
hi RedBar   term=reverse ctermfg=white ctermbg=red guifg=white guibg=red

within makegreen.vim are cleared by mvim just prior to calling the .gvimrc file. After mvim has started I get:

:hi RedBar
RedBar         xxx cleared    

:hi GreenBar
GreenBar         xxx cleared

Does anyone have any insights into why mvim is clobbering highlight groups? The only work around that I have found thus far is to redefine them again inside .gvimrc. But this is clearly a pain. Trying to figure out if I am missing something here.

Update

I just stripped down my .vimrc and using pathogen I only place makegreen in bundle dir. The result is the same behavior.

My .vimrc has only one line:

call pathogen#infect()

The bundle directory only contains makegreen bundle. The autoload directory only has the pathogen.vim. I removed .gvimrc.

I then start mvim and execute :hi RedBar and get the same result as above. I used an echo statement to confirm that makegreen.vim is being sourced.

I installed mvim with brew install macvim. The version of macvim is 7.3(64) and I am on OSX Lion.

Update 2

I just took it a step further and removed the reliance on pathogen. Now I only have makegreen.vim in plugin directory and an empty .vimrc file. Same result.

2
Works for me until I source my .vimrc again. Can we see your colorscheme and/or vimrc? - Conner
see update above for simple configuration - Rocketman
I have set none. The updates above are literally run with no vimrc nor gvimrc. I am starting to think that the cocoa implementation for macvim somehow does some type of a clear before sourcing the gvimrc file. I tracked it right to that point when the clear occurs. - Rocketman
Try :e $VIMRUNTIME/colors/default.vim and look at line 14 - Conner
Ahh. Yes. So what is the standard way for a plugin to set a color scheme when using mvim? It appears that all of the plugins are loaded and then hi clear gets called wiping them out. Should the plugin have used colors directory or something else? - Rocketman

2 Answers

1
votes

Add let macvim_skip_colorscheme=1 to your ~/.vimrc. See the comment before the colorscheme is loaded in your global gvimrc:

" Load the MacVim color scheme.  This can be disabled by loading another color
" scheme with the :colorscheme command, or by adding the line
"   let macvim_skip_colorscheme=1
" to ~/.vimrc.
if !exists("macvim_skip_colorscheme") && !exists("colors_name")
    colorscheme macvim
endif

All color schemes clear the highlights.

0
votes

I had the same problem. The workaround was to redefine GreenBar and RedBar in ~/.vimrc (or python.vim, etc.)