You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In kakoune, you can return any error code you want when quitting via :quit [exit code]. One example of where I use this functionality a lot is when I write a git commit message, save the buffer, but then realize there's something else I need to do (rather than accepting and then git reset --soft HEAD^).
One implementation detail would be what we want to do when there's more than 1 view (since :q really just closes views). Likely just return an error.
The text was updated successfully, but these errors were encountered:
Vim has a separate :cquit command which I use with git commit regularly:
:cq[uit][!]
:{N}cq[uit][!]
:cq[uit][!] {N} Quit Vim with error code {N}. {N} defaults to one.
Useful when Vim is called from another program:
e.g., a compiler will not compile the same file again,
`git commit` will abort the committing process, `fc`
(built-in for shells like bash and zsh) will not
execute the command, etc.
{N} can also be zero, in which case Vim exits
normally.
WARNING: All changes in files are lost. It works like
":qall!" |:qall|, except that Nvim exits non-zero or
[count].
I actually like that better. I was originally going to augment the existing :qa commands, but a dedicated command seems just right. Implemented in #1096.
Describe your feature request
In kakoune, you can return any error code you want when quitting via
:quit [exit code]
. One example of where I use this functionality a lot is when I write a git commit message, save the buffer, but then realize there's something else I need to do (rather than accepting and thengit reset --soft HEAD^
).One implementation detail would be what we want to do when there's more than 1 view (since
:q
really just closes views). Likely just return an error.The text was updated successfully, but these errors were encountered: