用Vim输入Git commit消息的问题 [英] Problems with entering Git commit message with Vim

查看:72
本文介绍了用Vim输入Git commit消息的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

操作系统:Windows



我写了

  $ git commit 

然后


<


我写了一些文字,例如


已添加表单验证

按Enter键不提交。然后我按下Shift + Enter,Ctrl + Enter,Alt + Enter - 仍然没有提交。



我觉得它很愚蠢,但我该怎么做?

解决方案

如果是VIM for Windows,您可以执行以下操作:


  • 按照所提供的指引输入您的讯息

  • 按下 Esc 以确保您不在插入模式中
  • $ b然后键入:wq Enter ZZ


请注意,在VIM中,通常有几种方法可以完成一件事。虽然这里有一点点区别。 :wq Enter 总是在关闭它之前写入当前文件,而 ZZ :x Enter :xi Enter :xit Enter :exi Enter :退出 回车只在文档被修改时才写入。

所有这些同义词只有不同数量的按键。

OS: Windows

I write

$ git commit

then

"# Please enter the commit message"

I write some text, like

"Form validation added"

Press Enter and not commited. Then i press Shift+Enter, Ctrl+Enter, Alt+Enter - still not commited.

I think its stupid trouble, but What i must to do?

解决方案

If it is VIM for Windows, you can do the following:

  • enter your message following the presented guidelines
  • press Esc to make sure you are out of the insert mode
  • then type :wqEnter or ZZ.

Note that in VIM there are often several ways to do one thing. Here there is a slight difference though. :wqEnter always writes the current file before closing it, while ZZ, :xEnter, :xiEnter, :xitEnter, :exiEnter and :exitEnter only write it if the document is modified.
All these synonyms just have different numbers of keypresses.

这篇关于用Vim输入Git commit消息的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆