2

It seems to be a known issue that the built-in version of vim in OSX Lion is broken and sometimes segfaults. For me, this happens when I open a combination of vertical and horizontal splits of different files and try to save one of them.

I found instructions at

http://www.jprabawa.com/2011/11/segmentation-fault-running-vim-on-os-x.html

that gives instructions on how to install a different version of vim to fix the problem, but when I run configure I get the following error:

jeff~/Documents/vim73$ ./configure --enable-gui=no
configure: loading cache auto/config.cache
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/Users/jeffreyhodes/Documents/vim73/src':
configure: error: C compiler cannot create executables
See `config.log' for more details.

I cannot find a config.log file.

I've been using MacVim in the meantime, but having two separate apps for editing programs and running them is a pain. Does anyone have any wisdom to share on this problem?

EDIT: After installing the command line tools from X-Code 4.3, ./configure works, but now running make gives the following error:

In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:120,
                 from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from os_macosx.m:19:
/System/Library/Frameworks/Foundation.framework/Headers/NSTask.h:75: error: syntax error before '^' token
In file included from /System/Library/Frameworks/AppKit.framework/Headers/NSResponder.h:9,
                 from /System/Library/Frameworks/AppKit.framework/Headers/NSView.h:8,
                 from /System/Library/Frameworks/AppKit.framework/Headers/NSText.h:8,
                 from /System/Library/Frameworks/AppKit.framework/Headers/NSCell.h:10,
                 from /System/Library/Frameworks/AppKit.framework/Headers/NSActionCell.h:8,
                 from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:15,
                 from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13,
                 from os_macosx.m:19:
/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:403: error: syntax error before '^' token
/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:403: error: 'type name' declared as function returning a function
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:17,
                 from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13,
                 from os_macosx.m:19:
/System/Library/Frameworks/AppKit.framework/Headers/NSAnimationContext.h:20: error: syntax error before '^' token
/System/Library/Frameworks/AppKit.framework/Headers/NSAnimationContext.h:20: error: 'type name' declared as function returning a function
/System/Library/Frameworks/AppKit.framework/Headers/NSAnimationContext.h:20: error: syntax error before '^' token
/System/Library/Frameworks/AppKit.framework/Headers/NSAnimationContext.h:20: error: 'type name' declared as function returning a function
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:54,
                 from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13,
                 from os_macosx.m:19:
/System/Library/Frameworks/AppKit.framework/Headers/NSDraggingItem.h:52: error: syntax error before '^' token
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:73,
                 from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13,
                 from os_macosx.m:19:
/System/Library/Frameworks/AppKit.framework/Headers/NSSpellChecker.h:168: error: syntax error before '^' token
/System/Library/Frameworks/AppKit.framework/Headers/NSSpellChecker.h:168: error: 'type name' declared as function returning a function
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:194,
                 from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13,
                 from os_macosx.m:19:
/System/Library/Frameworks/AppKit.framework/Headers/NSWindowRestoration.h:119: error: syntax error before '^' token
/System/Library/Frameworks/AppKit.framework/Headers/NSWindowRestoration.h:119: error: 'type name' declared as function returning a function
make[1]: *** [objects/os_macosx.o] Error 1
make: *** [first] Error 2

I've temporarily patched this problem by running macvim through the command line with mvim -v, but does anyone know how to solve the above problem?

Jeffrey
  • 1,681
  • 3
  • 13
  • 23
  • 1
    Do you have Xcode installed? If it is 4.3.x, did you install the command line tools package from its preferences dialog? If it is 4.2.x, did you run the "Install Xcode.app" which is what the App Store or downloadable installer actually creates? (Sadly an incomplete Xcode install can give you an entirely useless `/usr/bin/gcc`.) – geekosaur Apr 23 '12 at 06:13
  • 4
    Macvim can be run in the terminal as well: http://stackoverflow.com/questions/2056137/how-to-run-mvim-macvim-from-terminal – David Brown Apr 23 '12 at 06:18
  • geekosaur: I have 4.3.x, and it turns out that I hadn't installed the dev tools. Doing this gives me an error on make: `/System/Library/Frameworks/AppKit.framework/Headers/NSWindowRestoration.h:119: error: 'type name' declared as function returning a function`, which perplexes me. David: that works great, thanks! Are there any disadvantages to using terminal macvim instead of normal vim? – Jeffrey Apr 23 '12 at 06:28
  • 1
    MacVim is more Mac-like (shortcuts, clipboard, dialogs…) while CLI Vim (`/usr/bin/vim`, `mvim -v` or `/path/to/MacVim.app/Contents/MacOS/Vim`) is, as a CLI program, not very well integrated in Mac OS X. MacVim can show thousands of colors whereas CLI Vim is limited by your terminal emulator. Otherwise, they are the same. There are far more differences between MacVim's CLI executable and `/usr/bin/vim` but, in short, MacVim's is compiled with a bigger feature set than `/usr/bin/vim` and is more recent. You can compare with `:version`. – romainl Apr 23 '12 at 08:40
  • MacVim can be launched from the terminal, not run in the terminal. I personally prefer to run vim in a terminal in screen, as then I'm using the same vim everywhere (locally and remotely) – Brad Parks Jun 08 '12 at 13:23

1 Answers1

1

rm ~/.viminfo

crash would disappear

wartalker
  • 338
  • 4
  • 11