martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.2k stars 258 forks source link

Issues with the man page keybinding tables #1033

Open ilyagr opened 1 year ago

ilyagr commented 1 year ago
ilyagr commented 1 year ago

This is strictly speaking a separate issue, but I'll put it here. In all documentation, I'm quite confused by the description of the <C-c> command as "Remove count selection column" and the similar description of the <C-l> command.

After some experimentation, I think it removes all the selections that overlap the count column, or the current column by default, but I'm not entirely sure.

mcepl commented 1 year ago

I guess, I would say “patches welcome”. Somebody has to go and study how to fix those manpages. Could it be you, please?

rnpnr commented 1 year ago

For the first issue <C-k> and <C-u> do the same thing in visual mode. This is the same for the <C-d> and <C-j> pair. This is slightly more clear when using a manpager in the terminal but I will submit a patch making it more explicit.

For the second issue this seems to be a bug in mandoc.css which was just taken from upstream mandoc. I'm not intimately familiar with CSS so I don't know what the correct fix is but it can be hacked around with the following patch which has minimal effect on the rest of the page:

diff --git a/man/mandoc.css b/man/mandoc.css
index d75700a..50c54ec 100644
--- a/man/mandoc.css
+++ b/man/mandoc.css
@@ -143,7 +143,7 @@ h2.Ss {     margin-top: 1.2em;
        overflow: auto; }
 .Bl-compact {  margin-top: 0em; }
 .Bl-compact > dd {
-       margin-bottom: 0em; }
+       margin-bottom: 0.15em; }
 .Bl-compact > dt {
        margin-top: 0em; }

The problem is that the gh-pages branch is automatically generated. I guess I could submit a patch that applies the above using sed in the github workflow but it seems hacky.

rnpnr commented 1 year ago

I'm quite confused by the description of the <C-c> command as "Remove count selection column" and the similar description of the <C-l> command.

For this I don't think there is anything wrong with what the manpage says. It just that this is something that is hard to grasp without an example. Consider the following text and perform the steps that follow:

1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
  1. Select everything vi<Tab>
  2. Split the selection up :x/[1-5]/
  3. Remove all but count column 3<C-l>

Repeat but do the following instead:

  1. Remove count selection column 3<C-c>

Hope this helps!

ilyagr commented 1 year ago

I still find it a little confusing. I think one of the following would be clearer (note that the two options describe different behavior):

Thank you for the example, though. I haven't used vis for a while, but if I did, it would have helped (and I could figure out which of the options above it is).