How to run mvim (MacVim) from Terminal?

前端 未结 12 897
北荒
北荒 2020-11-30 15:55

I have MacVim installed and I am trying to set it up as the editor for Git (version control), but I can\'t run \'mvim\' from the command line as it isn\'t recognised. How d

12条回答
  •  执笔经年
    2020-11-30 16:59

    For Mac .app bundles, you should install them via cask, if available, as using symlinks can cause issues. You may even get the following warning if you brew linkapps:

    Unfortunately brew linkapps cannot behave nicely with e.g. Spotlight using either aliases or symlinks and Homebrew formulae do not build "proper" .app bundles that can be relocated. Instead, please consider using brew cask and migrate formulae using .apps to casks.

    For MacVim, you can install with:

    brew cask install macvim
    

    You should then be able to launch MacVim like you do any other macOS app, including mvim or open -a MacVim from a terminal session.

    UPDATE: A bit of clarification about brew and brew cask. In a nutshell, brew handles software at the unix level, whereas brew cask extends the functionality of brew into the macOS domain for additional functionality such as handling the location of macOS app bundles. Remember that brew is also implemented on Linux so it makes sense to have this division. There are other resources that explain the difference in more detail, such as What is the difference between brew and brew cask? so I won't say much more here.

提交回复
热议问题