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

查看:128
本文介绍了在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.)

我考虑按照此处的说明使用Mercurial(因为我已经将其用于其他用途).

I considered using Mercurial (as I already use it for other things), as per the instructions 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天全站免登陆