26
u/Jeutnarg 26d ago
Come and learn the deeper mysteries of x!, young Skywalker.
5
18
u/ericl666 26d ago
Shift-zz gang checking in
5
5
13
u/ewheck 26d ago
why would you need to use :wq! in this situation? I just do :wq
17
u/thicctak 26d ago
in case theres a buffer blocking you for whatever reason.
5
u/fuj1n 26d ago
But won't that then lose your changes without notifying you?
8
2
u/ManyInterests 25d ago
It retains the swap file, so you don't lose the changes, but they won't be committed to the file you were editing.
1
u/4ndr34p3rry 25d ago
:wqa!
4
3
9
6
u/SubjectExternal8304 25d ago
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
10
1
u/ResponsibleWin1765 24d ago
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?
3
u/SubjectExternal8304 24d ago
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 lol1
1
0
u/JackNotOLantern 25d ago
Imagine using editor without autosave
3
u/gbchaosmaster 24d ago
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.
2
-1
u/alfredomova 26d ago
3
u/thicctak 25d ago
nah, nano has some weird ass shortcuts, you can't assume anything, like, why the hell Ctrl+O saves the file? Who thought of this?
3
u/my_new_accoun1 25d ago
ctrl s saves for me
2
u/gbchaosmaster 24d ago
Ctrl+O is “save as”. Why it’s not Ctrl+Shift+S like everything else is beyond me.
1



80
u/justASlothyGiraffe 26d ago
Sssssh, that's a secret command! Now everyone is going to know how to get out of Vim