Can someone explain to me the point of the ! in this context? I’ve only ever used the ! when I want to exit vim without saving my changes via q! And I’ve never been unable to exit vim with just wq
I guess there might be some configuration where saving or quitting doesn't work and you're preemptively forcing it? What I don't get is why people use :wq instead of :x. Is it not the same thing?
For me it’s just habit of frequently using :w to save while I’m writing and then when I exit I just do the same thing and add the q. Never really thought about it tbh. Only thing I could think of why someone would intentionally use :wq over :x would be if they hadn’t made any changes but still wanted to update the files time stamp? Not really sure why you’d want or need to do that but someone more knowledgeable could probably explain the reasoning lol
It does have autosave. Every 200 characters while typing, or whenever you haven’t typed for 4 seconds. If the process is killed it’ll prompt you to restore the next time you open that file.
If you mean autosave like it overwrites the file that I’m working on without me telling it to, that’s stupid, I don’t want that. But there’s plugins for those that do.
80
u/justASlothyGiraffe Oct 08 '26
Sssssh, that's a secret command! Now everyone is going to know how to get out of Vim
26
u/Jeutnarg Oct 08 '26
Come and learn the deeper mysteries of x!, young Skywalker.
18
u/ericl666 Oct 08 '26
Shift-zz gang checking in
13
u/ewheck Oct 08 '26
why would you need to use
:wq!in this situation? I just do:wq9
u/Delirious_85 Oct 09 '26
wait 'till you hear about `:x`
6
u/SubjectExternal8304 Oct 08 '26
Can someone explain to me the point of the ! in this context? I’ve only ever used the ! when I want to exit vim without saving my changes via q!
And I’ve never been unable to exit vim with just wq
0
u/JackNotOLantern Oct 08 '26
Imagine using editor without autosave
-1
u/alfredomova Oct 08 '26
nano users: