我已经安装了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.
其他回答
我不认为我需要在路径上添加任何东西
brew install macvim
mvim -v
然后应该打开macvim在终端,你也可以继续和别名吗
alias vim='mvim -v'
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.
我强烈建议通过MacPorts安装MacVim (sudo port install MacVim)。
当安装时,MacPorts会自动更新你的配置文件以包含/opt/local/bin在你的路径中,所以当mvim在安装MacVim期间被安装为/opt/local/bin/mvim时,你会发现它可以直接使用。
当你安装MacVim端口时,MacVim。app bundle也安装在/Applications/MacPorts中。
走MacPorts路线的一个好处是,你也可以安装git (sudo port install git-core)和许多其他端口。强烈推荐。
如果你安装了homeBrew,这就是你所要做的:
brew install macvim
brew linkapps
然后在终端中输入mvim来运行MacVim。
在.bz2文件的根目录下应该有一个名为mvim的脚本。把它复制到你的$PATH (/usr/local/bin会很好),你应该排序。
推荐文章
- Mac/OS X上的/var/lib/docker在哪里
- 如何合并2 JSON对象从2个文件使用jq?
- Xcode构建失败“架构x86_64未定义的符号”
- 如何回到行之前编辑的最后一个在Vim?
- 在OSX 10.11中安装Scrapy时,“OSError: [Errno 1]操作不允许”(El Capitan)(系统完整性保护)
- 如何在Mac OS X 10.6中使硬件发出哔哔声
- 如何触发命令行PHP脚本的XDebug分析器?
- 从Cocoa应用程序执行一个终端命令
- Android Studio无法找到有效的Jvm(与MAC OS相关)
- 如何跳转到一个特定的人物在vim?
- 如何删除一个大的文本块而不计算行?
- NSRange从Swift Range?
- Maven命令行如何指向特定的settings.xml为单个命令?
- 如何在交互式Python中查看整个命令历史?
- 如何循环通过文件匹配通配符在批处理文件