@rettichschnidi

Is... that an emoji, or an ex/vi command? ;)

@rl_dane It is what one should use in vi/vim instead of :wq

@rettichschnidi

Interesting. vi's manpage is "clear as mud" on the topic:

[Ee]x[!] [+cmd] [file] Edit a different file. ... [range] x[it][!] [file] Write the file if it has been modified.

But vim's help (editing.txt) is actually helpful:

*:x* *:xit* :[range]x[it][!] [++opt] [file] Like ":wq", but write only when changes have been made. When 'hidden' is set and there are more windows, the current buffer becomes hidden, after writing the file. This command is not supported in |Vim9| script, because it is too easily confused with a variable name. *:exi* *:exit* :[range]exi[t][!] [++opt] [file] Same as :xit.

I'll have to start using :x. ;)

@rl_dane

nvi of course, as you know.

The problem with #nvi's manual is that it is employing two different uses of []. For [Ee] it's doing the conventional set of characters to match thing, as the commands are actually Ex and ex, for everything else [] is indicating an optional string, not a set at all. [Ee][dit] on the line above is an even worse example.

Amusingly: For genuine Joy+Horton #vi, not only is all this on the ex(1) manual page instead, but it is a lot clearer, in part because actual vi doesn't support uppercasing its ex command to Ex.

https://illumos.org/man/1HAS/ex#additional-ex-command-arguments

@rettichschnidi

#ex

illumos: manual page: ex.1has

@rl_dane

Fun fact: The :x command was added to ex/vi in 1980 because :wq did too much. Horton copied the name from hed.

https://github.com/dspinellis/unix-history-repo/blob/BSD-4_3-Snapshot-Development/usr/src/ucb/ex/ex.news#L382

@rettichschnidi

#ex #vi #vim #nvi #nex #hed #BSD

unix-history-repo/usr/src/ucb/ex/ex.news at BSD-4_3-Snapshot-Development Β· dspinellis/unix-history-repo

Continuous Unix commit history from 1970 until today - dspinellis/unix-history-repo

GitHub

@JdeBP @rettichschnidi

Sorry, what's "hed?"

@rl_dane

When at UW-Madison, Horton derived 'hed' from 'ed' before taking over 'vi' from Bill Joy.

https://cs.wisc.edu/2023/04/03/spotlight-on-mary-ann-horton/

@rettichschnidi
#hed #vi #Unix #ComputerHistory