我怎样才能使vim指向macvim?在哪里可以找到macvim? [英] How can I get vim to point to macvim? Where can I find macvim?

查看:118
本文介绍了我怎样才能使vim指向macvim?在哪里可以找到macvim?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让vim指向macvim:)

I would like vim to point to macvim :)

可能是通过别名.

vim在这里:whereis vim /usr/bin/vim

vim is here: whereis vim /usr/bin/vim

macvim我找不到,例如 whereis macvim不返回任何内容

macvim I can't find, e.g. whereis macvim returns nothing

推荐答案

我的回答与michaelmichael的相反,我已经做到了

My answer is kind of the opposite of michaelmichael's and I've made it quite a few times:

MacVim附带一个CLI可执行文件,如果您在~/.bashrc/~/.profile中添加一个别名,则可以使用该可执行文件代替Mac OS X的默认Vim.无需编译任何东西,无需将MacVim放在一个特殊的位置,无需使用符号链接覆盖默认程序

MacVim comes with a CLI executable that you can use in place of Mac OS X's default Vim if you add a single alias to your ~/.bashrc/~/.profile. No need to compile anything, no need to put MacVim in a special place, no need to overwrite default programs with symlinks

这样,您可以留在CLI领域,享受功能强大/最新/快速的Vim的强大功能.

This way, you can stay in CLI-land and enjoy the power of a powerful/recent/fast Vim.

编辑

MacVim是Vim的本地Mac OS X GUI版本.它没有预装在您的操作系统中,因此您必须从以下位置下载它互联网或通过自制软件安装(请参阅michaelmichael的答案).安装完成后,MacVim便是您放置它的地方,简单明了.

MacVim is a native Mac OS X GUI version of Vim. It doesn't come preinstalled with your OS so you have to download it from the Internet or install it through homebrew (see michaelmichael's answer). Once it's installed, MacVim is where you have put it, plain and simple.

由于MacVim是成熟的GUI应用程序,因此不能真正用作终端中默认Vim的直接替代品.

Because it's a full fledged GUI app, MacVim can't really be used as a drop-in replacement for the default Vim in the terminal.

`$ MacVim file.txt` will not work. `$ open -a macvim file.txt` will not work either.

基本上,您有两个选择:使用mvim CLI包装器从终端打开MacVim,或使用MacVim捆绑的CLI可执行文件的别名.

You basically have two options: use the mvim CLI wrapper to open MacVim from the terminal or use an alias to MacVim's bundled CLI executable.

  1. mvim包装器

  1. The mvim wrapper

我认为michaelmichael的答案可能会有所扩展,但最重要的说.

I think michaelmichael's answer could be a expanded a bit but the most important is said.

很好地解决了这个问题.

well scratch that.

捆绑的CLI可执行文件

只需将此行(自定义以反映您的系统)添加到您的~/.bashrc~/.profile或启动时由Shell运行的任何文件中即可:

Just add this line (customized to reflect your system) to your ~/.bashrc or ~/.profile or whatever file is run by your shell at startup:

alias vim='/path/to/MacVim.app/Contents/MacOS/Vim'

打开一个新的终端窗口,$ vim file.txt应该在终端窗口中启动vim,就像默认的/usr/bin/vim一样,但是有很多麻烦.

Open a new terminal window, $ vim file.txt should launch vim in your terminal window, just like the default /usr/bin/vim but with a lot more bells and whistles.

这篇关于我怎样才能使vim指向macvim?在哪里可以找到macvim?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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