ZZ
:silent! waTell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
11–20 of 279 posts
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#12> This command is not supported in Vim9 script, because it is too easily confused with a variable name.
So you can’t just write “x”, but must instead go for something bland like “exit”, or something exciting like “exe'x'”. (I’m presuming “execute 'x'” will work, but my mental model of how you’d unsupport the command in Vim9 script could be wrong.)
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#13Why 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
#14`: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?
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#15Why 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
#16Why 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
#17Keybinds (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
#18Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#19Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#20Why would it write if no changes have been made?