Search code examples
vimvi

Why does VIM's help page prepend every help command with ["x]?


When I look up the help page for a specific command, I see it formatted in a cryptic way. For example typing :h x brings up the following:

 ["x]<Del>  or                              <Del> x dl
 ["x]x      Delete [count] characters under and after the cursor
            [into register x] (not |linewise|).  Does the same as
            "dl"...

My question: What does the ["x] before the command represent?


Solution

  • The [ and ] indicate that this part is optional. The " means literally type " and x is an example of a register name. As it says in the description, if you use x here the deleted characters will be placed in register x. You could equally type "ax to delete the character and put it in the a register, or "_x to delete the character and send it to the black-hole register (discarding it completely).

    Try :help registers to find out more about the available registers and how they are used.