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/MacVim.app/Contents/MacOS/Vim -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 :)

Comments

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.
René Dudfield said…
hrmm... I can't find the 'mvim' on my machine.

find /Applications/MacVim.app -name mvim
find /usr/local/ -name mvim
find /opt/ -name mvim
find /usr/bin/ -name mvim
Anonymouz said…
The mvim binary comes in the dmg, but its not part of the app/installer.
Vinay said…
It should be,

function gvim { /Applications/MacVim.app/Contents/MacOS/Vim -g "$*"; }

to open files with spaces.

Popular posts from this blog

Draft 3 of, ^Let's write a unit test!^

Is PostgreSQL good enough?

post modern C tooling - draft 6