Comments
cbeams
added a commit
to cbeams/dotfiles
that referenced
this issue
Jul 16, 2014
walkerlee
added a commit
to walkerlee/dotfiles
that referenced
this issue
Sep 22, 2014
sandlerb
added a commit
to sandlerb/dotfiles
that referenced
this issue
Mar 15, 2015
jacobsa
added a commit
to jacobsa/dotfiles
that referenced
this issue
May 14, 2015
balintk
added a commit
to balintk/dotfiles
that referenced
this issue
Sep 6, 2015
jackqt
added a commit
to jackqt/oh-my-zsh
that referenced
this issue
Nov 20, 2015
sukima
added a commit
to sukima/vimrc
that referenced
this issue
Dec 17, 2015
cappert
added a commit
to cappert/test
that referenced
this issue
Feb 28, 2016
yotsuba1022
referenced
this issue
in yotsuba1022/my-cmd-settings
Apr 21, 2017
ahastudio
added a commit
to ahastudio/dotfiles
that referenced
this issue
Jan 28, 2021
ahastudio
added a commit
to ahastudio/dotfiles
that referenced
this issue
Jan 28, 2021
Sometimes git puts this message: > hint: Waiting for your editor to close the file... > error: There was a problem with the editor 'vi'. Just do this! > Git Commit Problem: "error: There was a problem with the editor 'vi'" > VundleVim/Vundle.vim#167
I have this strange problem with using vi
as the editor for git commit -a
.
Normal flow is: I type git commit -a
, vi
appears, I enter my commit message, and then :wq
to save & exit from vi
.
This works fine. However, sometimes I make a typo and instead of :wq
I type :Wq
(because I use the shift for :
). Then, when I correct myself and type :wq
again, git
gives the following error:
error: There was a problem with the editor 'vi'.
Please supply the message using either -m or -F option.
How can I fix this?
daviesgeek
37.2k51 gold badges158 silver badges200 bronze badges
asked Jul 26, 2012 at 17:05
2
vi
is existing with a non-zero status, although without additional details about your setup, it’s difficult to tell why. If you’re using a lot of plugins to vim
, you might try moving your .vimrc
file to .vimrc.back
and seeing if you can replicate. There are a few sources that discuss this problem, including at least one with a potential solution:
git config --global core.editor /usr/bin/vim
I would try removing your .vimrc
first, however. It seems to cause more consternation.
answered Jul 27, 2012 at 9:20
ChristopherChristopher
3662 silver badges4 bronze badges
2
Do you use the golang vim plugins?
This line is causing the vi exit value problem for me:
filetype plugin indent off
Removing the whole golang plugin block in .vimrc
fixed the problem. Installing the golang plugin using fugitive can be as easy as: ln -s $GOROOT/misc/vim ~/.vim/bundle/vim-golang
(I just documented the problem in this issue on the vim-golang github)
answered Apr 24, 2014 at 9:01
Something is wrong with Git config I guess.
So the solution is to reset Git config and it worked for me:
git config --global core.editor $(which vim)
$(which vim)
is more flexible than /usr/bin/vim
(vim executable may not be there for some people)
answered Oct 20, 2016 at 1:34
ericnericn
1931 gold badge1 silver badge7 bronze badges
You must log in to answer this question.
Not the answer you’re looking for? Browse other questions tagged
.
Not the answer you’re looking for? Browse other questions tagged
.
У меня есть эта странная проблема с использованием vi
в качестве редактора для git commit -a
.
Обычный поток: я печатаю git commit -a
, vi
появляется, я ввожу свое сообщение о коммите, а затем :wq
сохраняю и выхожу из него vi
.
Это отлично работает. Тем не менее, иногда я делаю опечатку и вместо того, чтобы :wq
печатать :Wq
(потому что я использую Shift для :
). Затем, когда я исправляю себя и печатаю :wq
снова, git
выдает следующую ошибку:
error: There was a problem with the editor 'vi'.
Please supply the message using either -m or -F option.
Как я могу это исправить?
Ответы:
vi
существует с ненулевым статусом, хотя без дополнительных подробностей о вашей настройке трудно сказать, почему. Если вы используете много плагинов для vim
, вы можете попробовать переместить .vimrc
файл в .vimrc.back
и посмотреть, сможете ли вы воспроизвести. Есть несколько источников, которые обсуждают эту проблему, в том числе по крайней мере один с потенциальным решением:
git config --global core.editor /usr/bin/vim
Я бы попробовал удалить твою .vimrc
первую, однако. Кажется, это вызывает еще больший ужас.
Вы используете плагины golang vim? Эта строка вызывает у меня проблему со значением выхода vi:
filetype plugin indent off
Удаление целого блока плагинов golang .vimrc
исправило проблему. Установить плагин golang с помощью fugitive можно так же просто, как:ln -s $GOROOT/misc/vim ~/.vim/bundle/vim-golang
(Я только что задокументировал проблему в этом выпуске на github vim-golang )
Я думаю, что-то не так с Git config.
Таким образом, решение состоит в том, чтобы сбросить конфиг Git, и он работал для меня:
git config --global core.editor $(which vim)
$(which vim)
является более гибким, чем /usr/bin/vim
(исполняемый файл vim может быть недоступен для некоторых людей)