At Mon, 24 Feb 2025 22:11:02 +0000 (UTC), RVP <[email protected]> wrote: Subject: Re: stupid question on vi > > On Sun, 23 Feb 2025, Greg A. Woods wrote: > > > At Sun, 23 Feb 2025 06:44:02 +0000 (UTC), RVP <[email protected]> wrote: > > Subject: Re: stupid question on vi > >> > >> nvi(1) has a poorly-documented Ctrl-X key > > > > Looks very well documented to me: > > > > <control-X>[0-9A-Fa-f]+ > > Insert a character with the specified hexadecimal value into > > the > > text. > > > > Well, how many chars. does that `+' imply? Depends on the version of nvi(1) > you > have. The Ubuntu/Debian version permits more than 2, so you can type in > Unicode > code-points for emojis. The *BSD versions (nvi and nvi2) don't. > > In a UTF-8 locale, are the 2 hex-chars. converted to UTF-8 chars? Yes, on > Net and FreeBSD, but, not on OpenBSD.
Versions other than the one in NetBSD really aren't relevant here. :-)
> The man-page, as you've shown, says "into the text", which implies input into
> the document text
"imply"? I would say it's pretty explicit. The word "text" (when not
appearing before the word "editor") in the manual page usually refers to
"document text", though there are exceptions, such as "/text"
(i.e. search text).
To nail it down even more the section where ^X is described is headlined
with the opening text:
The following section describes the commands available in the text
input mode of the vi editor.
I.e. effectively they're "non-modal" commands, or rather "mode-specific"
commands! Hmmm... vi has commands that can be entered without being in
command mode!
> (set fileencoding=...).
Now that's something that's not documented! (at all, so far as I can
find within NetBSD)
> But, what about, at the prompt, like
> `/' or `:'? Can I create a filename using that <Ctrl-X>NN?
I wouldn't expect any such thing given what the documentation says
("available in text input mode", implying _not_ available in command
mode, though clearly some of the others do work in command mode), so if
it works, well, that'd be nice.
I am still puzzled by the lack of mention in the built-in cheat-sheet.
--
Greg A. Woods <[email protected]>
Kelowna, BC +1 250 762-7675 RoboHack <[email protected]>
Planix, Inc. <[email protected]> Avoncote Farms <[email protected]>
pgp4pN46zMbPZ.pgp
Description: OpenPGP Digital Signature
