tags:

views:

382

answers:

3

Hi,

I get the error below after I run "git commit ."

CSApprox needs gui support - not loading.
  See :help |csapprox-+gui| for possible workarounds.
Error detected while processing /Users/{username}/.vim/plugin/syntastic.vim:
line   94:
E319: Sorry, the command is not available in this version: sign define SyntasticError text=>> texthl=error
line   95:
E319: Sorry, the command is not available in this version: sign define SyntasticWarning text=>> texthl=todo
Press ENTER or type command to continue
error: There was a problem with the editor 'vi'.
Please supply the message using either -m or -F option.

Any ideas why this might be happening? I am on a mac.

Thanks for your help.

+3  A: 

It looks like your git editor is not set and vi has a messed up plugin or something on your mac. Try using the -m "comment here" paramter on your commit.

I would suggest mv ~/.vim ~/.vimbak and try running vi again.

Courtney Palit
Yes, an issue with a plugin. I was totally confused why it was trying to launch an editor, but now I understand. The switch "-m" totally worked... I guess I should read up on all the available switches
iHeartDucks
+2  A: 

First off, are you sure you want to be doing git commit . ? git commit is usually what you want.

The error messages are coming from you editor. It looks like git is trying to invoke vi, but there are settings in something like your .vimrc which aren't supported by the command line vi that you are using.

What happens when you invoke vi from your command line?

If you do not want to use vi as your commit editor, you can use the GIT_EDITOR environment variable to cause git invoke a different editor. You need to make sure that the editor runs as a foreground process, though, so that git knows when you've finished editing your message. Some editors can be invoked with a launcher script to help with this as it's common for editors (especially in Mac OS X) launch as a background process when invoked from a terminal.

Charles Bailey
Yes, I wanted to say "git commit".. Sorry a newbee here ;-) I was confused why it was trying to open the vi editor, but now I know why. Yes, I do get the same error message why I try to open vi or vim. I have to figure out what's going on there. I changed my editor using the environment variable so I guess I can relax for a while.
iHeartDucks
Do you have vim setup? When you open vim on command line do you get the same errors? Is git trying to open different version of vim than what you normally use?
stefanB
A: 

Looks like you're using the CSApprox vim plugin on mac. However, the mac's terminal does not support 256 colors (only 16 I believe).

You can try iTerm instead of the mac's Terminal. Watch out for memory usage though.

Also, if you go this route, tell vim that the terminal supports 256 colors by adding this to your ~/.vimrc:

set t_Co=256

If all this fails, and you don't mind the default colorscheme when using vim from the terminal, you can load the colorscheme only for MacVim (and completely remove the CSApprox plugin):

if has('gui_running')
  :colorscheme wombat
endif
hgimenez