Hi Jason, hi Anthony,

Jason McIntyre wrote on Sat, Feb 03, 2018 at 02:52:26PM +0000:

> ok, but it does not currently say that. hence the original post:
>       [Vi]i[sual]
> that seems an obvious mistake, as noted in the original post.

That section of the manual is full of lies in multiple respects.
I never used split screens, so i never noticed in the past.

> so we could quick-fix that. but now we see that [Vv] itself is
> problematic, as also noted. i'd be inclined to say we should just list
> them as lowercase commands, and note separately what happens if the
> command begins uppercase.

I think the lowercase and uppercase versions are sufficiently different
to document them separately.

> there again, why does the EX COMMANDS section list commands that are
> "vi only"?

Historical misdesign.  Originally, Bill Joy wrote ex(1) for 1BSD in 1977.
Then he wrote vi(1) for 2BSD in 1979.  He completely botched the design
in so far as he kept the concept of "ex commands" and introduced an
additional, completely different concept of "vi commands".  Both
provide distinct, but significantly redundant functionality.

So in vi(1), you can append text to a line using the vi "a" command,
or you can append a new line using the vi "o" command, or you can
append a new line using the ex "a" command, which has completely
different syntax and semantics.

Given that concept of ex commands in vi, even though it originally
emerged as a backward compatibility concept, at some point, ex
commands appeared that can only be used in vi, but not in ex:  KISS!

That said, here is a patch to fix most of the lies in one go.

OK?
  Ingo

P.S.
Note that the concept of screens is not very well thought out.
For example, it interacts very erratically with the concept of
next and previous files from the command line.  I wouldn't mind
completely zapping the concept of split screens from vi(1), it
isn't required by POSIX.  Then again, i won't get myself killed
over the proposal to scrap the feature if anybody wants to keep it.


Index: vi.1
===================================================================
RCS file: /cvs/src/usr.bin/vi/docs/USD.doc/vi.man/vi.1,v
retrieving revision 1.74
diff -u -p -r1.74 vi.1
--- vi.1        22 Aug 2017 20:27:18 -0000      1.74
+++ vi.1        3 Feb 2018 15:54:16 -0000
@@ -1794,19 +1794,22 @@ Delete the lines from the file.
 Display buffers, screens or tags.
 .Pp
 .It Xo
-.Op Cm Ee Ns
-.Op Cm dit Ns
+.Cm e Ns Op Cm dit Ns | Ns Cm x Ns
 .Op Cm !\&
 .Op Ar +cmd
 .Op Ar file
 .Xc
+Edit a different file.
+.Pp
 .It Xo
-.Op Cm Ee Ns
-.Cm x Ns Op Cm !\&
+.Cm E Ns Op Cm dit Ns | Ns Cm x Ns
+.Op Cm !\&
 .Op Ar +cmd
 .Op Ar file
 .Xc
-Edit a different file.
+.Nm vi
+only.
+Split the screen and edit a different file.
 .Pp
 .It Xo
 .Cm exu Ns Op Cm sage
@@ -1822,14 +1825,15 @@ command.
 .Xc
 Display and optionally change the file name.
 .Pp
-.It Xo
-.Op Cm Ff Ns
-.Cm g
-.Op Ar name
-.Xc
+.It Cm fg Op Ar name
+.Nm vi
+only.
+Background the current screen and foreground the specified screen instead.
+.Pp
+.It Cm Fg Op Ar name
 .Nm vi
-mode only.
-Foreground the specified screen.
+only.
+Split the screen and foreground the specified screen.
 .Pp
 .It Xo
 .Op Ar range
@@ -1880,9 +1884,9 @@ Display the lines unambiguously.
 .Cm map Ns Op Cm !\&
 .Op Ar lhs rhs
 .Xc
-Define or display maps (for
 .Nm vi
-only).
+only.
+Define or display maps.
 .Pp
 .It Xo
 .Op Ar line
@@ -1912,12 +1916,20 @@ Write the abbreviations, editor options 
 .Ar file .
 .Pp
 .It Xo
-.Op Cm Nn Ns
-.Op Cm ext Ns
+.Cm n Ns Op Cm ext Ns
 .Op Cm !\&
 .Op Ar file ...
 .Xc
 Edit the next file from the argument list.
+.Pp
+.It Xo
+.Cm N Ns Op Cm ext Ns
+.Op Cm !\&
+.Op Ar file ...
+.Xc
+.Nm vi
+only.
+Split the screen and edit the next file from the argument list.
 .\" .Pp
 .\" .It Xo
 .\" .Op Ar line
@@ -1933,13 +1945,14 @@ Save the file in a form that can later b
 .Fl r
 option.
 .Pp
-.It Xo
-.Op Cm \&Pp Ns
-.Cm rev Ns Op Cm ious Ns
-.Op Cm !\&
-.Xc
+.It Cm prev Ns Oo Cm ious Oc Ns Op Cm !\&
 Edit the previous file from the argument list.
 .Pp
+.It Cm Prev Ns Oo Cm ious Oc Ns Op Cm !\&
+.Nm vi
+only.
+Split the screen and edit the previous file from the argument list.
+.Pp
 .It Xo
 .Op Ar range
 .Cm p Ns Op Cm rint
@@ -1959,7 +1972,7 @@ Append buffer contents to the current li
 .Cm q Ns Op Cm uit Ns
 .Op Cm !\&
 .Xc
-End the editing session.
+End editing the file and close the current screen.
 .Pp
 .It Xo
 .Op Ar line
@@ -1980,10 +1993,10 @@ if it was previously saved.
 .It Xo
 .Cm res Ns Op Cm ize
 .Op Cm + Ns | Ns Cm - Ns
-.Ar size
+.Ar lines
 .Xc
 .Nm vi
-mode only.
+only.
 Grow or shrink the current screen.
 .Pp
 .It Xo
@@ -2132,14 +2145,22 @@ character is usually
 .Aq control-Z .
 .Pp
 .It Xo
-.Op Cm Tt Ns
-.Cm a Ns Op Cm g Ns
+.Cm ta Ns Op Cm g Ns
 .Op Cm !\&
 .Ar tagstring
 .Xc
 Edit the file containing the specified tag.
 .Pp
 .It Xo
+.Cm \&Ta Ns Op Cm g Ns
+.Op Cm !\&
+.Ar tagstring
+.Xc
+.Nm vi
+only.
+Split the screen and edit the file containing the specified tag.
+.Pp
+.It Xo
 .Cm tagn Ns Op Cm ext Ns
 .Op Cm !\&
 .Xc
@@ -2195,22 +2216,31 @@ editor.
 .Op Ar flags
 .Xc
 .Nm ex
-mode only.
+only.
 Enter
 .Nm vi .
 .Pp
 .It Xo
-.Op Cm Vi Ns
-.Cm i Ns Op Cm sual Ns
+.Cm vi Ns Op Cm sual Ns
 .Op Cm !\&
 .Op Ar +cmd
 .Op Ar file
 .Xc
 .Nm vi
-mode only.
+only.
 Edit a new file.
 .Pp
 .It Xo
+.Cm Vi Ns Op Cm sual Ns
+.Op Cm !\&
+.Op Ar +cmd
+.Op Ar file
+.Xc
+.Nm vi
+only.
+Split the screen and edit a new file.
+.Pp
+.It Xo
 .Cm viu Ns Op Cm sage
 .Op Ar command
 .Xc
@@ -2231,19 +2261,23 @@ command.
 .Op Cm !\&
 .Op Ar file
 .Xc
+Write the file.
+.Pp
 .It Xo
 .Op Ar range
 .Cm wn Ns Op Cm !\&
 .Op >>
 .Op Ar file
 .Xc
+Write the file and edit the next file from the argument list.
+.Pp
 .It Xo
 .Op Ar range
 .Cm wq Ns Op Cm !\&
 .Op >>
 .Op Ar file
 .Xc
-Write the file.
+Write the file and close the current screen.
 .Pp
 .It Xo
 .Op Ar range
@@ -2251,8 +2285,7 @@ Write the file.
 .Op Cm !\&
 .Op Ar file
 .Xc
-Exit the editor,
-writing the file if it has been modified.
+Write the file if it has been modified and close the current screen.
 .Pp
 .It Xo
 .Op Ar range

Reply via email to