:help :x
Like ":wq", but write only when changes have been made.Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
1–10 of 279 posts
`:x` leaves the modification time of files untouched if nothing was changed.
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#2WHAT
My life just began again. Thank you
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#3I had a CS prof years ago tell us all the only thing we needed to know about vi(m) was the dammit key
As in "escape-q-dammit"
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#4Cumulatively, you've just saved quite a lot of my time - thanks!
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#5Keybinds (in normal mode):
Shift + ZZ -> :x (save only if needed and quit)
Shift + ZQ -> :q! (quit without saving)
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#6Keybinds (in normal mode): Shift + ZZ -> :x (save only if needed and quit) Shift + ZQ -> :q! (quit without saving)
huh. I'm using ZZ all the time, but I thought it is :wq
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#7I had a CS prof years ago tell us all the only thing we needed to know about vi(m) was the dammit key As in "escape-q-dammit"
Just throwing another one out there:
`Ctrl + [` instead of `Esc` to save some finger travel.Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#8Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#9Why would it write if no changes have been made?
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#10You can also type ZZ (no colon) while in normal mode to exit and save.
This also appears to only write when changes have been made (according to some testing in neovim on my local machine).