我已经安装了MacVim,我正试图将其设置为Git(版本控制)的编辑器,但我不能从命令行运行“mvim”,因为它不被识别。我如何设置mvim,以便我可以从终端运行它?
当前回答
In addition, if you want to use MacVim (or GVim) as $VISUAL or $EDITOR, you should be aware that by default MacVim will fork a new process from the parent, resulting in the MacVim return value not reaching the parent process. This may confuse other applications, but Git seems to check the status of a temporary commit message file, which bypasses this limitation. In general, it is a good practice to export VISUAL='mvim -f' to ensure MacVim will not fork a new process when called, which should give you what you want when using it with your shell environment.
其他回答
在.bz2文件的根目录下应该有一个名为mvim的脚本。把它复制到你的$PATH (/usr/local/bin会很好),你应该排序。
如果你安装了homeBrew,这就是你所要做的:
brew install macvim
brew linkapps
然后在终端中输入mvim来运行MacVim。
假设MacVim安装在Application文件夹中。
不要在你的环境中添加MacVim路径,而是在terminal中输入以下命令创建一个链接:
sudo ln -s /Applications/MacVim。应用程序/内容/ bin / mvim /usr/local/bin/mvim
然后,打开一个新的终端窗口/选项卡,输入mvim。
如果你选择brew路径,最好的安装方式是:
brew install macvim --with-override-system-vim
这将在/usr/local/bin中提供mvim, vim, vi, view等(所有符号链接到地窖中的副本)。这也消除了创建任何别名的需要,并将您的vi、vim等更改为使用与MacVim相同的vim发行版。
In addition, if you want to use MacVim (or GVim) as $VISUAL or $EDITOR, you should be aware that by default MacVim will fork a new process from the parent, resulting in the MacVim return value not reaching the parent process. This may confuse other applications, but Git seems to check the status of a temporary commit message file, which bypasses this limitation. In general, it is a good practice to export VISUAL='mvim -f' to ensure MacVim will not fork a new process when called, which should give you what you want when using it with your shell environment.
推荐文章
- 如何在Windows命令提示符下运行.sh ?
- “你有邮件”的消息在终端,os X
- 如何从命令行通过mysql运行一个查询?
- Mac OS X中的环境变量
- 如何从命令行在windows中找到mysql数据目录
- 如何从命令行安装cygwin组件?
- 如何更改Git日志日期格式
- 如何在Vim注释掉一个Python代码块
- 如何从macOS完全卸载蟒蛇
- 如何在Makefile中设置子进程的环境变量
- 如何让“wc -l”打印没有文件名的行数?
- 有效地测试Linux上的端口是否打开?
- 如何从另一个文件A中删除文件B中出现的行?
- 如何配置Mac OS X术语,使git有颜色?
- Shell脚本删除超过n天的目录