LoginSignup
7
4

More than 5 years have passed since last update.

Homebrew で vim のかわりに macvim をターミナル上で使う

Posted at

Homebrew にはターミナル版の vim と別に、GUIをサポートした macvim というパッケージも入っています。

実は macvim はコマンドラインでも動作します。GUIで動くかターミナルで動くかはコマンド名で判断しているので、 mvim のかわりに vim というコマンドで起動すればターミナル版が起動します。

両方インストールしている人は、 vim をアンインストールして vim -> mvim というシンボリックリンクを作れば少し軽量化することができます。

$ brew uninstall vim
Uninstalling /usr/local/Cellar/vim/8.0.1553_1... (1,429 files, 22.9MB)
$ cd /usr/local/bin
$ ln -sf ./mvim vim

これで vim を起動して、 :version を確認してみましょう。

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Mar  1 2018 23:02:28)
macOS version
Included patches: 1-1522
Compiled by Homebrew
Huge version with MacVim GUI.  Features included (+) or not (-):
...

ちなみに、 vim は ruby と perl に依存していますが、 macvim は依存していません。なので、 vim が使いたいだけで ruby と perl は macOS が提供するもので構わない人は、 brew uninstall ruby perl することができます。

$ brew info vim
...
==> Dependencies
Required: perl ✘, ruby ✘
Recommended: python ✔
Optional: gettext ✔, lua ✘, luajit ✔, python@2 ✘
...

$ brew info macvim
...
==> Dependencies
Recommended: cscope ✔, python ✔
Optional: lua ✘, luajit ✔, python@2 ✘
...
7
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
4