3 ms·
> Also, don't use :q!, just use ZZ, its quicker. But ZZ is equivalent to :wq, which is different. If OP finds themself in a text file in vim by accident and st
by losvedir 15y ago
> Also, don't use :q!, just use ZZ, its quicker.
But ZZ is equivalent to :wq, which is different. If OP finds themself in a text file in vim by accident and started typing a word, they will likely NOT want to save those changes. (Hence OP's :q!, rather than :q.)
- mitchty 15y agoIf you've made changes then yes its not equivalent, keep in mind I NEVER open a file for editing unless I intend to edit. That is what view/more/less are for.
- losvedir 15y agoOh, cool! I didn't know about view, actually... I'd been using vim to poke around in files because I'm familiar with the navigation key commands, and was always keen to make sure not to edit something. But opening as read-only is great!