:help :check inconsistent with :check

18 views
Skip to first unread message

John Little

unread,
Jun 1, 2019, 8:27:48 PM6/1/19
to vim_use
I just struck an inconsistency that had me confused.

I was watching a steadily growing log file, and with autoread set, I used the command

:check

and nothing happened (but for a message I didn't understand). So I went to the help and ran

:help :check

and got the help for the command I thought I was running. Eventually I worked out that :check is actually :checkpath, and I should have used :checktime.

But surely ":h :xyz" should give the help for ":xyz", but am I missing something?

Tony Mechelynck

unread,
Jun 1, 2019, 9:54:53 PM6/1/19
to vim_use
The online help has a tag for the full command (:checktime or
:checkpath) and for the _shortest_ abbreviation. Now the shortest
abbreviation for :checkpath is :che, not :check; so :help :check will
get you the first tag found which begins with :check, not necessarily
the ex-command for which :check is accepted as an abbreviation (for
this, line 827 of doc/tagsrch.txt would have had to be:
*che* *chec* *check* *checkp* *checkpa* *checkpat* *checkpath*
instead of just the first and last ones of these; similarly for _all_
other ex-commands, which I believe would have made the doc/tags file
much bigger.

:help :check<Tab> (with 'wildmenu' on) or :help :check<Ctrl-D> would
have shown you all helptags beginning with :check, namely :checkt,
:checkpath and :checktime. It would also _not_ have shown you :check
because there is no help tag so named.

Best regards,
Tony.

John Little

unread,
Jun 2, 2019, 6:48:56 AM6/2/19
to vim_use

On Sunday, June 2, 2019 at 1:54:53 PM UTC+12, Tony Mechelynck wrote:
> for this, line 827 of doc/tagsrch.txt would have had to be:
> *che* *chec* *check* *checkp* *checkpa* *checkpat* *checkpath*
> instead of just the first and last ones of these; similarly for _all_
> other ex-commands, which I believe would have made the doc/tags file
> much bigger.

Extra tags would only be needed where there's ambiguity. I compiled a list; the middle column is what you get if you type the given at the : command prompt, and the third column is the topic you get if you ask for help for the given:

given | : | :help :
--------+--------------+-------------
arg | args | arga
bre | brewind | break
cab | cabbrev | cabclear
cadd | caddbuffer | caddexpr
chec | checkpath | checktime
cne | cnext | cnewer
cnor | cnoremap | cnoreabbrev
cun | cunmap | cunabbrev
diff | diffupdate | diffget
doaut | doautocmd | doautoall
end | endif | endfunction
folddo | folddopen | folddoc
inor | inoremap | inoreabbrev
keep | keepmarks | keepalt
ladd | laddbuffer | laddexpr
lfi | lfile | lfirst
lge | lgetfile | lgetbuffer
lma | lmap | lmake
lock | lockmarks | lockvar
mkvi | mkvimrc | mkview
sfi | sfind | sfirst
snore | snoremap | snoremenu
ver | version | verbose

One or two extra tags for each of these is not going to significantly add to vim's 10,000 or so.

> :help :check<Tab> (with 'wildmenu' on) or :help :check<Ctrl-D> would
> have shown you all helptags beginning with :check

How would I have known to do that, when I did not know that there might be another command starting with "check"? I use the help when I don't know stuff, that's the point of it.

Regards, John Little

Tony Mechelynck

unread,
Jun 2, 2019, 7:04:37 AM6/2/19
to vim_use
On Sun, Jun 2, 2019 at 12:48 PM John Little <john.b...@gmail.com> wrote:
> > :help :check<Tab> (with 'wildmenu' on) or :help :check<Ctrl-D> would
> > have shown you all helptags beginning with :check
>
> How would I have known to do that, when I did not know that there might be another command starting with "check"? I use the help when I don't know stuff, that's the point of it.
>
> Regards, John Little

Well, I suppose it's a question of how we relate to encyclopaedic
sources of information. When I was a little kid, I would spend hours
with the 7-volume dictionary (7 thick folio volumes IIRC); nowadays I
can spend hours going from subject to subject by following hotlinks in
the Wikipedia — or in the Vim help; and it proves to me how true was
the remark of Socrates: «The more I know, and the more I'm conscious
of how little I know».

How would you have known, when you didn't know there was another
comand starting with :check? Well, seeing that the help didn't jibe
with what you saw, you might have wondered if there weren't another
command starting with :check, and asked for a list — if you had known
how to; though the <Tab> key is used for more than one kind of
completion, and it is very useful.

Best regards,
Tony.

Bram Moolenaar

unread,
Jun 2, 2019, 7:22:55 AM6/2/19
to vim...@googlegroups.com, John Little
The tag of :checkpath is ":che", which is the shortest form. Apparently
for ":help :check" it finds ":checkt" or ":checktime" first.
I'll add a tag for ":check" at ":checkpath", that will fix it.

--
hundred-and-one symptoms of being an internet addict:
83. Batteries in the TV remote now last for months.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Bram Moolenaar

unread,
Jun 2, 2019, 7:49:06 AM6/2/19
to vim...@googlegroups.com, John Little

John Little wrote:

> On Sunday, June 2, 2019 at 1:54:53 PM UTC+12, Tony Mechelynck wrote:
> > for this, line 827 of doc/tagsrch.txt would have had to be:
> > *che* *chec* *check* *checkp* *checkpa* *checkpat* *checkpath*
> > instead of just the first and last ones of these; similarly for _all_
> > other ex-commands, which I believe would have made the doc/tags file
> > much bigger.
>
> Extra tags would only be needed where there's ambiguity. I compiled a
> list; the middle column is what you get if you type the given at the :
> command prompt, and the third column is the topic you get if you ask
> for help for the given:

Thanks, that is very useful. I don't know how you generated this, but I
assume these are the useful ones.

>
> given | : | :help :
> --------+--------------+-------------
> arg | args | arga
> bre | brewind | break
> cab | cabbrev | cabclear
> cadd | caddbuffer | caddexpr
> chec | checkpath | checktime
> cne | cnext | cnewer
> cnor | cnoremap | cnoreabbrev
> cun | cunmap | cunabbrev
> diff | diffupdate | diffget
> doaut | doautocmd | doautoall
> end | endif | endfunction
> folddo | folddopen | folddoc
> inor | inoremap | inoreabbrev
> keep | keepmarks | keepalt
> ladd | laddbuffer | laddexpr

This one is the wrong way around, :ladd stands for :laddexpr.

> lfi | lfile | lfirst
> lge | lgetfile | lgetbuffer
> lma | lmap | lmake
> lock | lockmarks | lockvar
> mkvi | mkvimrc | mkview
> sfi | sfind | sfirst
> snore | snoremap | snoremenu
> ver | version | verbose
>
> One or two extra tags for each of these is not going to significantly
> add to vim's 10,000 or so.
>
> > :help :check<Tab> (with 'wildmenu' on) or :help :check<Ctrl-D> would
> > have shown you all helptags beginning with :check
>
> How would I have known to do that, when I did not know that there
> might be another command starting with "check"? I use the help when I
> don't know stuff, that's the point of it.

--
Ed's Radiator Shop: The Best Place in Town to Take a Leak.
Reply all
Reply to author
Forward
0 new messages