What is the difference between MacVim and regular Vim?

137,414

Solution 1

MacVim is just Vim. Anything you are used to do in Vim will work exactly the same way in MacVim.

MacVim is more integrated in the whole OS than Vim in the Terminal or even GVim in Linux, it follows a lot of Mac OS X's conventions.

If you work mainly with GUI apps (YummyFTP + GitX + Charles, for example) you may prefer MacVim.

If you work mainly with CLI apps (ssh + svn + tcpdump, for example) you may prefer vim in the terminal.

Entering and leaving one realm (CLI) for the other (GUI) and vice-versa can be "expensive".

I use both MacVim and Vim depending on the task and the context: if I'm in CLI-land I'll just type vim filename and if I'm in GUI-land I'll just invoke Quicksilver and launch MacVim.

When I switched from TextMate I kind of liked the fact that MacVim supported almost all of the regular shortcuts Mac users are accustomed to. I added some of my own, mimiking TextMate but, since I was working in multiple environments I forced my self to learn the vim way. Now I use both MacVim and Vim almost exactly the same way. Using one or the other is just a question of context for me.

Also, like El Isra said, the default vim (CLI) in OS X is slightly outdated. You may install an up-to-date version via MacPorts or you can install MacVim and add an alias to your .profile:

alias vim='/path/to/MacVim.app/Contents/MacOS/Vim'

to have the same vim in MacVim and Terminal.app.

Another difference is that many great colorschemes out there work out of the box in MacVim but look terrible in the Terminal.app which only supports 8 colors (+ highlights) but you can use iTerm — which can be set up to support 256 colors — instead of Terminal.

So… basically my advice is to just use both.

EDIT: I didn't try it but the latest version of Terminal.app (in 10.7) is supposed to support 256 colors. I'm still on 10.6.x at work so I'll still use iTerm2 for a while.

EDIT: An even better way to use MacVim's CLI executable in your shell is to move the mvim script bundled with MacVim somewhere in your $PATH and use this command:

$ mvim -v

EDIT: Yes, Terminal.app now supports 256 colors. So if you don't need iTerm2's advanced features you can safely use the default terminal emulator.

Solution 2

EDIT: See comment from @Luke Davis.

Old answer:

The one reason I have which made switching to MacVim worth it: Yank uses the system clipboard.

I can finally copy paste between MacVim on my terminal and the rest of my applications.

Solution 3

It's all about the key bindings which one can simply achieve from .vimrc configurations. As far as clipboard is concerned you can use :set clipboard unnamed and the yank from vim will go to system clipboard. Anyways, whichever one you end up using I suggest using this vimrc config , it contains a whole lot of plugins and bindings which will make your experience smooth.

Solution 4

unfortunately, with "mvim -v", ALT plus arrow windows still does not work. I have not found any way to enable it :-(

Share:
137,414

Related videos on Youtube

Mark Costello
Author by

Mark Costello

Updated on May 10, 2022

Comments

  • Mark Costello
    Mark Costello about 2 years

    I'm reasonably new to OS X, but I'm familiar with Vim from using it in various *nix systems. I've seen many people recommend running MacVim over Vim in the terminal. Can anyone tell me what differences there are between MacVim and regular Vim?

    • ldog
      ldog about 13 years
      Probably has to do with mac friendly keybindings (ctrl vs command keys)
  • Greg K
    Greg K over 12 years
    Homebrew is a painless package manager vs macports, once homebrew is installed simply brew install macvim and you're set. mxcl.github.com/homebrew
  • Chev
    Chev over 10 years
    +1 for homebrew. I've had way better luck with brew than I have with macports. Though macports still has more packages than homebrew.
  • pellucide
    pellucide almost 10 years
    @Greg how is macports any harder sudo port install macvim
  • Roy Tinker
    Roy Tinker over 6 years
    @pellucide Sure, installing one package isn't any more painful. But IMHO managing dependencies and OS-default packages vs. installed packages is a lot easier in Homebrew. Also, sudo is never required in homebrew.
  • Roy Tinker
    Roy Tinker over 6 years
    Thanks for the mvim command, I installed MacVim via HomeBrew but didn't know there was a default symlinked command. Thanks!
  • Luke Davis
    Luke Davis over 6 years
    You can also use the * register in terminal VIM to yank onto the system clipboard. Which IMO is better because I personally don't always want to sync to my system clipboard. So in VIM, when yanking a line for example, use "*yy to copy to the clipboard.
  • Jim Deville
    Jim Deville over 5 years
    vim.wikia.com/wiki/Accessing_the_system_clipboard - all you have to do is add a line to your .vimrc for this to be default as well
  • smallwat3r
    smallwat3r almost 5 years
    If you want to yank to clipboard in terminal vim just add a +, for example if you'd like to copy the whole content to clipboard :%y+
  • qiubix
    qiubix over 2 years
    Fun fact: when installing macvim via homebrew emacs is installed as one of dependencies :D
  • romainl
    romainl over 2 years
    I don't see anything to that effect in the recipe but one of the dependencies may have Emacs as dependency and Emacs is installed by default on Macs anyway.
  • someguyinafloppyhat
    someguyinafloppyhat about 2 years
    "MacVim is just Vim." Does that mean that MacVim relies on some form of terminal (which might be different for Mac and Win)? Or is it completely divorced from the terminal (i.e. stand alone)?
  • romainl
    romainl about 2 years
    @someguyinafloppyhat, Vim is a terminal application and the GUI in GVim (Windows/Linux) and MacVim (Mac OS X) is, for all intent and purpose, a glorified terminal emulator.