GIT_EDITOR不使用macvim

Nic*_*ilt 42 git bash

这就是我在〜/ .bashrc中的内容

export GIT_EDITOR='/Applications/MacVim.app/Contents/MacOS/Vim -g '
Run Code Online (Sandbox Code Playgroud)

当我发出

git commit
Run Code Online (Sandbox Code Playgroud)

然后我得到一个macvim编辑器,但在命令行上我看到了这条消息

$ git commit
Aborting commit due to empty commit message.
Run Code Online (Sandbox Code Playgroud)

如果我使用更改GIT_EDITOR来使用textmate,那么事情就可以了

export GIT_EDITOR='/usr/local/bin/mate -w'
Run Code Online (Sandbox Code Playgroud)

我不想用textmate.我想用macvim.我正在使用mac并使用bash.

CB *_*ley 69

您需要为-fvim 提供选项,以确保它不是背景本身.


9mo*_*eys 34

我有同样的问题.我通过从命令行运行以下命令将mvim设置为git的默认编辑器来修复它:

git config --global core.editor "mvim -f"
Run Code Online (Sandbox Code Playgroud)


mra*_*ruz 10

这对我很有用.
git config --global core.editor 'mvim -f --nomru -c "au VimLeave * !open -a iTerm"'
如果您使用Terminal.app而不是iTerm.app您可以将其切换出来.来源:https://github.com/b4winckler/macvim/wiki/FAQ(尽管他们使用的是EDITOR env变量而不是gitconfig)