4 ms·
I'd never heard of the :cq command in vim before. Seems useful, but in practice it's so unknown that things like editing the git commit message cannot rely on i
by gpvos 3y ago
I'd never heard of the :cq command in vim before. Seems useful, but in practice it's so unknown that things like editing the git commit message cannot rely on it and instead check whether the file has been changed. Also, reading its documentation, it probably would be better named :cqall .
- cassepipe 3y agoI was wondering that too although I don't have access to vim right now. What's the punch line ? EDIT : The difference with :q! is the exit code ! (Yes, and :wall is actually the :update command on all your buffers, that is, unlike :w, buffers are written only if there has been changes. Bad naming is the mother of all pedagocical pain)
- andrewshadura 3y agoAs far as I remember, it works with git commit just fine. It's also far from being unknown.
- gpvos 3y agoYeah, I should've written "cannot rely on that alone and also check". I've worked with vi, later vim, for 34 years and read about it here first; ddg'ing for it doesn't give many hits.
- manx 3y agoI use that often for aborting the current commit or the current git interactive rebase
- kiprasmel 3y agoit's v useful if you want to abort, e.g. when editing an interactive rebase & decide to not go thru w/ it.