ちなみに vim の終了方法としては :cq というのもあり、これを実行すると vim が終了コード 1 で終了します。git commit をキャンセルする場合に使えます。
— mattn (@mattn_jp) 2019年6月26日
だいぶ昔のツイートなのですが, さっき知ったので忘備録的にブログに書いておきます.
CLIでGitを操作してて, commit logはnvimで書いてるんですが, たまにgit commit
した後に「あ, commitするbranch間違えた...!」みたいに気づくことがあって困ることがありました.
mattnさんのツイートにもあるように, :cq
で閉じると,
hint: Waiting for your editor to close the file... error: There was a problem with the editor 'nvim'. Please supply the message using either -m or -F option.
となって, コミットすることなくnvimを閉じることができます.