更新 Mac OS X 上的内置 vim [英] Update built-in vim on Mac OS X

查看:24
本文介绍了更新 Mac OS X 上的内置 vim的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这在 Ask Different 可能更合适,但是当我尝试在那里添加标签时,没有 vim 标签,只有 macvim.所以我想我可能会在这里找到更好的观众.

I know this might be more appropriate at Ask Different, but as I tried adding tags there, there was no vim tag, only macvim. So I figured I might get a better audience here.

在终端中,我执行以下操作

In the Terminal, I do the following

$ vim --version
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Jan 31 2010 13:33:49)

当我浏览到 http://www.vim.org 时,我看到一条新闻

When I browse to http://www.vim.org, I see a news item

Vim 7.3 发布!

Vim 7.3 released!

如何更新我的内置 vim?我非常想干净利落地做(即没有重复安装,或任何额外的下载,没有 macports 等)

How do I update my built-in vim? I would very much like to do it cleanly (i.e. no duplicate installations, or any additional downloads, no macports, etc.)

根据here.

$ hg clone https://vim.googlecode.com.hg/ vim
$ cd vim/src
$ make

但我认为这会导致重复安装.尽管我上面提到了干净"的要求,但也欢迎使用不干净"的解决方案,因为也许真的没有其他办法.

But I think that would make a duplicate installation. Despite my "clean" requirement as mentioned above, "unclean" solutions are also welcome, since maybe there really is no other way.

推荐答案

不要覆盖内置的 Vim.

Don't overwrite the built-in Vim.

相反,从不同位置的源代码安装它,或者通过 Homebrew 或 MacPorts 在其默认位置安装,然后将此行添加到您的 .bashrc 或 .profile:

Instead, install it from source in a different location or via Homebrew or MacPorts in their default location then add this line to your .bashrc or .profile:

alias vim='/path/to/your/own/vim'

和/或更改您的 $PATH 以便它在默认位置之前查看其位置.

and/or change your $PATH so that it looks into its location before the default location.

在我看来,最好的办法是下载最新的 MacVim,它带有一个非常完整的 vim 可执行文件,然后像这样在 Terminal.app 中使用它.

The best thing to do, in my opinion, is to simply download the latest MacVim which comes with a very complete vim executable and use it in Terminal.app like so.

alias vim='/Applications/MacVim.app/Contents/MacOS/Vim' # or something like that, YMMV

这篇关于更新 Mac OS X 上的内置 vim的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆