6

When searching the help for "count", :h count I'm shown the help page:

                            *count* *[count]*
[count] An optional number that may precede the command to multiply
        or iterate the command.  If no number is given, a count of one
        is used, unless otherwise noted.  Note that in this manual the
        [count] is not mentioned in the description of the command,
        but only in the explanation.  This was done to make the
        commands easier to look up.  If the 'showcmd' option is on,
        the (partially) entered count is shown at the bottom of the
        window.  You can use <Del> to erase the last digit (|N<Del>|).

I'm curious, what is the notation *count* *[count]* telling me?

More specifically:

  • What is the significance of the asterisk *?
  • What do the lack or presence of brackets [] mean?
5

The meaning of the * (or more specifically *word*) is, that this defines a help tag you can jump to. So if you enter :h count Vim knows where to get you to have you read about the count. This also matters for completion and highlighting (by default the * will be concealed so it won't be visible).

If you write a help document and you want to reference such a word, it is written within |word| so that you can put your cursor on word and press CTRL] and Vim will jump to the definition of the word.

I believe the notation [word] is just a denotion for the word being optionally for certain commands, e.g. look at :h J and see how it talks about [count] (if it is not given a default of 1 is being assumed (except for joining lines where a default of 2 is used)).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.