Saturday, August 08, 2009

gvim cmdline OSX - macvim from the terminal

macvim doesn't seem to install a 'gvim' command. So opening files from the terminal with gvim doesn't work.

Add this to your .bash_profile
function gvim { /Applications/ -g $*; }

Then you'll need to source your shell, or open new shell tabs. Or paste that line into your current shell. Then you can open your files again with OSX gvim and the terminal.

aaaaaaah. Sigh of relief at being able to open files from the cmd line again :)


Ryan Phillips said...

I have an mvim script installed on my OSX machine. I'm pretty sure macvim installed it.

Lucian said...

I've had to manually put my mvim somewhere on my PATH, but it does come in the macvim .dmg.

illume said...

hrmm... I can't find the 'mvim' on my machine.

find /Applications/ -name mvim
find /usr/local/ -name mvim
find /opt/ -name mvim
find /usr/bin/ -name mvim

WadeMealing said...

The mvim binary comes in the dmg, but its not part of the app/installer.

Vinay said...

It should be,

function gvim { /Applications/ -g "$*"; }

to open files with spaces.