Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trying to Commit with vim. <esc> :wq not working?

Tags:

git

vim

I am trying to commit with vim. I am seeing everywhere that you save the commit by doing <esc> :wq. But I do esc, and once I hit : it seems to go back to edit mode and writes the wq in my commit message.

What am I doing wrong?

like image 738
itamar Avatar asked Jun 11 '26 05:06

itamar


2 Answers

But I do esc, and once I hit : it seems to go back to edit mode

It looks like your Vim is in easy mode, emulating other modeless editors. See :help easy.

To quit in this mode, use Ctrl + O followed by :wq Enter. You could also turn off easy mode via :set noinsertmode, and (if you haven't yet given up on Vim) fix the invocation, probably in your Git config (i.e. remove the -y argument from the vim call).

like image 114
Ingo Karkat Avatar answered Jun 14 '26 04:06

Ingo Karkat


I had the same problem: make sure your keyboard configuration didn't change language.

like image 30
HAL9000 Avatar answered Jun 14 '26 05:06

HAL9000