Y
Hacker News
new
|
ask
|
show
|
jobs
by
delusional
1526 days ago
Depends on your editor i suppose, but vipe checks the exit code of it [1]. In vim you can exit with an error using :cq
[1]:
https://github.com/pgdr/moreutils/blob/f4a811d0a1fafb3d7b0e7...
2 comments
foresto
1526 days ago
Exiting vim with :cq is also handy for backing out of git commits.
link
delusional
1525 days ago
I use the mnemonic "cancel-quit" for exactly that reason.
link
reayn
1526 days ago
Pressing ZQ in insert mode also provides the same effect!
link
CGamesPlay
1525 days ago
Actually, it doesn’t. ZQ is the same as :q! which quits without saving with a 0 exit code. So all of your git branches get deleted in this example, since you left the file as it was. You definitely want :cq here.
link
toxik
1526 days ago
In normal mode, not insert mode. ZQ in insert mode inserts ZQ.
link
reayn
1526 days ago
Oh my bad, i had a bit of a stroke writing my comment lol.
link