Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
537 points`:x` leaves the modification time of files untouched if nothing was changed.
:help :x
Like ":wq", but write only when changes have been made.
Comments (270) 59 threads
Earlier comments`:x` is one of only like 8 commands I know!
I'm surprised that it's apparently not one of the basic commands everyone knows?
What most didn't know (myself included) is that the behavior is slightly different from wq.
silent !stty -ixon > /dev/null 2>/dev/null
nnoremap :x
inoremap :x
0: https://github.com/hakluke/how-to-exit-vim
All comments shown.
Couldn't load more comments. Check your connection and try again.