cannot allocate color errors in terminal

146 views
Skip to first unread message

Chris Lott

unread,
Nov 27, 2012, 2:32:58 PM11/27/12
to vim...@googlegroups.com
(I've found a few proposed solutions for this problem, but none of
them work for me.)

**Problem**

I am trying to use Vim as the git core.editor -- no matter what I do,
I get "cannot allocate color" messages.

I've tried setting the git core.editor (using --replace-all) to vim,
mvim, vim -U NONE -u NONE, mvim -u NONE -U NONE, etc.

**Notes**

* I have nothing referring to Vim in my .bashrc

* I have a `/usr/bin/vim` that is aliased to `/usr/bin/vim ->
/Applications/MacVim.app/Contents/MacOS/Vim`

* I have no aliases for vim or mvim set

* If I execute vim in the terminal it starts up just fine, no errors

* echo $TERM responds `xterm-256color`

**Environment**

Vim Version:

IM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep 1 2012 18:08:47)
MacOS X (unix) version
Included patches: 1-646

OS: `OS X 10.8.2`

Bash: `GNU bash, version 4.2.39(2)-release (i386-apple-darwin12.2.1)`


Any ideas?

c
--
Chris Lott <ch...@chrislott.org>

Andrew Stewart

unread,
Nov 28, 2012, 3:50:09 AM11/28/12
to vim...@googlegroups.com

On 27 Nov 2012, at 20:32, Chris Lott wrote:
> **Problem**
>
> I am trying to use Vim as the git core.editor -- no matter what I do,
> I get "cannot allocate color" messages.
>
> I've tried setting the git core.editor (using --replace-all) to vim,
> mvim, vim -U NONE -u NONE, mvim -u NONE -U NONE, etc.

I don't what the problem is, but as a shot in the dark:

I set the EDITOR variable in my environment to the full path to MacVim's executable.

export EDITOR=/Applications/MacVim.app/Contents/MacOS/Vim

I don't have GIT_EDITOR set, nor core.editor, nor VISUAL.

Do you have anything configured in the color section of your git config?

Yours,
Andy Stewart

Randy McMillan

unread,
Nov 28, 2012, 4:11:48 AM11/28/12
to vim...@googlegroups.com

By setting the editor variable toeditor = /Applications/MacVim.app/Contents/MacOS/Vim instead, you can invoke the correct binaries. To be very specific, your `~/.gitconfig' file should include the following:

[core]
    editor = /Applications/MacVim.app/Contents/MacOS/Vim

ScreenShot 2012-11-28 at 4.10.08 AM.PNG
Reply all
Reply to author
Forward
0 new messages