1

Is there a way to list the command line arguments showed by vim -h or vim --help from within Vim?

Besides :r!vim -h which seems to be a workaround to achieve this.

4
  • Could you elaborate and tell us what you would like to achieve, why do you like to have the command line argument of Vim within Vim. It will help us to provide the adequate solution. Commented Sep 1, 2023 at 14:30
  • 1
    @VivianDeSmedt just write the content of the -h display. I'm making a kind of cheatsheet and every now and then I'm in the need of taking a look at that information. :r!vim -h is fine but I'm curious about other way to do it
    – ranemirusG
    Commented Sep 1, 2023 at 14:34
  • Could you tell us why you don't like the solution you have proposed (I personally have nothing against workaround per se ;-) ). What does make the workaround not practical? Commented Sep 1, 2023 at 14:37
  • 1
    @VivianDeSmedt oh no that there is anything wrong with that! At first I thought it should be in a text file, but it seems to be part of the binary. So maybe this redirection is the only way
    – ranemirusG
    Commented Sep 1, 2023 at 14:44

1 Answer 1

2

From :h vim-arguments:

                            *info-message*
The |--help| and |--version| arguments cause Vim to print a message and then
exit.  Normally the message is sent to stdout, thus can be redirected to a
file with: >

    vim --help >file

From inside Vim: >

    :read !vim --help

In :h vim-arguments is a detailed explanation of each argument. Although not in the same abbreviated formatting as in the command line helper.

1
  • 1
    "Although not in the same abbreviated formatting as in the command line helper." and thus more helpful.
    – romainl
    Commented Sep 1, 2023 at 15:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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