macos 在 Mac OS X 上为 VIM 安装 Ruby 支持
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3272999/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Install Ruby support for VIM on Mac OS X
提问by JoHaan
Mac OS X 10.6 (Snow Leopard) has VIM pre-installed (version 7.2), which is great.
Mac OS X 10.6 (Snow Leopard) 预装了 VIM(7.2 版),非常棒。
It also has Ruby pre-installed (version 1.8.7) which is great too.
它还预装了 Ruby(版本 1.8.7),这也很棒。
However, I want Ruby autocompletion in VIM. Looking up the VIM version (vim --version) shows -ruby (i.e. ruby support isn't enabled).
但是,我希望在 VIM 中使用 Ruby 自动完成功能。查找 VIM 版本 (vim --version) 显示 -ruby(即未启用 ruby 支持)。
How to enable ruby for my VIM installation?
如何为我的 VIM 安装启用 ruby?
采纳答案by Bill Odom
While it's possible to build and install your own Vim to replace the pre-installed version, I don't recommend it. It's far easier to just use MacVim instead:
虽然可以构建和安装自己的 Vim 来替换预安装的版本,但我不建议这样做。使用 MacVim 来代替要容易得多:
http://code.google.com/p/macvim/
http://code.google.com/p/macvim/
MacVim is a very Mac-friendly version of Vim, and it's got Ruby support already built in. It can be used as both a GUI and Terminal application. (Check out :help macvim-start
from within MacVim for details.)
MacVim 是一个对 Mac 非常友好的 Vim 版本,它已经内置了 Ruby 支持。它可以用作 GUI 和终端应用程序。(:help macvim-start
从 MacVim 中查看详细信息。)
回答by GlennR
+1 for MacVim - I also use it and love it.
+1 MacVim - 我也使用它并喜欢它。
But if you want a fresh vim compiled with ruby support, you can build one from scratch on OSX by following this article:
但是,如果您想要使用 ruby 支持编译的新 vim,您可以按照这篇文章在 OSX 上从头开始构建一个:
http://brilliantcorners.org/2011/02/building-vim-on-osx-snow-leopard/
http://brilliantcorners.org/2011/02/building-vim-on-osx-snow-leopard/
Only took me about 5 minutes to do...
我只花了大约 5 分钟就完成了...