4 ms·
Nice story, but :wq ? I've mapped ZZ to :w, ZX to :x, and QQ to ZQ / :q! to quit.
by jacknews 6y ago
Nice story, but
:wq ?
I've mapped ZZ to :w, ZX to :x, and QQ to ZQ / :q! to quit.
- lunchladydoris 6y agoIn case anyone else hasn't heard of or used :x > Like “:wq”, but write only when changes have been made. https://til.hashrocket.com/posts/2fdb6afb66-difference-between-wq-and-x https://til.hashrocket.com/posts/2fdb6afb66-difference-betwe...
- arendtio 6y agoSome time ago, I read, that the usage of :x is discouraged, as the typo :X is easy to make and leads to encrypting the file accidentally.
- lucb1e 6y agoTIL vim has encryption. If you're annoyed by typoing stuff, like I'm annoyed by typing :Wq or :WQ, you can just alias it of course. Since you (and, presumably, nobody) ever use(s) vim encryption it doesn't matter to override it. vimrc: command Wq wq command WQ wq command W w command Q q
- seszett 6y agoMy problem is writing :x instead of :w (on an AZERTY keyboard) and accidentally exiting when I just wanted to save.
- hiq 6y agoUse neovim instead to solve this problem, :X has been removed (and you shouldn't use it in vim either anyway).
- mkl 6y agoYes. By default, ZZ is the same as :x (write if changed, then exit). Quicker and better than :wq.