Error there was a problem with the editor

I'm just starting to use Vundle and I'm running into an error when editing a Git message using the .vimrc setup from the README. When I try to save any git message in vim, I get the followi...

Comments

@codyaray

cbeams

added a commit
to cbeams/dotfiles
that referenced
this issue

Jul 16, 2014

@cbeams

walkerlee

added a commit
to walkerlee/dotfiles
that referenced
this issue

Sep 22, 2014

@walkerlee

sandlerb

added a commit
to sandlerb/dotfiles
that referenced
this issue

Mar 15, 2015

@sandlerb

jacobsa

added a commit
to jacobsa/dotfiles
that referenced
this issue

May 14, 2015

@jacobsa

balintk

added a commit
to balintk/dotfiles
that referenced
this issue

Sep 6, 2015

@balintk

jackqt

added a commit
to jackqt/oh-my-zsh
that referenced
this issue

Nov 20, 2015

@jackqt

sukima

added a commit
to sukima/vimrc
that referenced
this issue

Dec 17, 2015

@sukima

cappert

added a commit
to cappert/test
that referenced
this issue

Feb 28, 2016

@cappert

yotsuba1022

referenced
this issue
in yotsuba1022/my-cmd-settings

Apr 21, 2017

@yotsuba1022

ahastudio

added a commit
to ahastudio/dotfiles
that referenced
this issue

Jan 28, 2021

@ahastudio

ahastudio

added a commit
to ahastudio/dotfiles
that referenced
this issue

Jan 28, 2021

@ahastudio

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's user avatar

daviesgeek

37.2k51 gold badges158 silver badges200 bronze badges

asked Jul 26, 2012 at 17:05

houbysoft's user avatar

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

Christopher's user avatar

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

Jan's user avatar

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

ericn's user avatar

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

.


У меня есть эта странная проблема с использованием 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 может быть недоступен для некоторых людей)

Понравилась статья? Поделить с друзьями:
  • Error the vc runtime redistributable package was not installed successfully setup cannot continue
  • Error the value of systemcoreclock is not usable in a constant expression
  • Error the username or password you entered is incorrect lost your password перевести
  • Error the tag image in 0 points to a nonexistent file screenshot jpg
  • Error the system cannot find the path specified торрент