I have set some options to configure completion on the command line, for commands that support it.

I use the completion on the commandline very often with the :help command; That will be my example, but my question is about commandline completion in general.

If I have only a vague idea how the help topic, I type a substring I expect in the name, and press tab, showing a list of possible completions.
The list is often long enough to be not easily read through; this is an example where a search in the list would be useful.

In the screen shown below, the substring entered was CTRL-W. The first Tab listed the four columns. (Note it includes variants not starting with the substring.)
After pressing Tab again, the second to last line was shown, repeating part of the table above it. Further Tab presses cycle through that line.

:help CTRL-W
CTRL-W           CTRL-W_b         CTRL-W_g]        CTRL-W_CTRL-I
CTRL-W_+         CTRL-W_c         CTRL-W_g}        CTRL-W_CTRL-J
CTRL-W_-         CTRL-W_d         c_CTRL-W         CTRL-W_CTRL-K
CTRL-W_<         CTRL-W_f         i_CTRL-W         CTRL-W_CTRL-L
CTRL-W_=         CTRL-W_h         CTRL-W_gF        CTRL-W_CTRL-N
CTRL-W_>         CTRL-W_i         CTRL-W_gf        CTRL-W_CTRL-O
CTRL-W_]         CTRL-W_j         CTRL-W_<BS>      CTRL-W_CTRL-P
CTRL-W_^         CTRL-W_k         CTRL-W_<CR>      CTRL-W_CTRL-Q
CTRL-W__         CTRL-W_l         CTRL-W_<Up>      CTRL-W_CTRL-R
CTRL-W_}         CTRL-W_n         CTRL-W_bar       CTRL-W_CTRL-S
CTRL-W_F         CTRL-W_o         CTRL-W_<Down>    CTRL-W_CTRL-T
CTRL-W_H         CTRL-W_p         CTRL-W_<Left>    CTRL-W_CTRL-V
CTRL-W_J         CTRL-W_q         CTRL-W_CTRL-]    CTRL-W_CTRL-W
CTRL-W_K         CTRL-W_r         CTRL-W_CTRL-^    CTRL-W_CTRL-X
CTRL-W_L         CTRL-W_s         CTRL-W_CTRL-_    CTRL-W_CTRL-Z
CTRL-W_P         CTRL-W_t         CTRL-W_CTRL-B    CTRL-W_<Enter>
CTRL-W_R         CTRL-W_v         CTRL-W_CTRL-C    CTRL-W_<Right>
CTRL-W_S         CTRL-W_w         CTRL-W_CTRL-D    CTRL-W_g_CTRL-]
CTRL-W_T         CTRL-W_x         CTRL-W_CTRL-F    c_CTRL-R_CTRL-W
CTRL-W_W         CTRL-W_z         CTRL-W_CTRL-H
:help CTRL-W_<

The list of completions is often longer than one page, which causes a prompt for the next page.
In that case, the search would be even more helpful.

  • 1
    You can continue to add to your search and press tab again.
    – jecxjo
    Apr 18, 2015 at 2:11

1 Answer 1


You can try the helpgrep command:

:helpg[rep] {pattern}[@xx]
    Search all help text files and make a list of lines
    in which {pattern} matches.  Jumps to the first match.
    The optional [@xx] specifies that only matches in the
    "xx" language are to be found.
    You can navigate through the matches with the
    quickfix commands, e.g., :cnext to jump to the
    next one.  Or use :cwindow to get the list of
    matches in the quickfix window.

By default, it opens the first match. You can use :clist to see the list of all matches:

 1 cmdline.txt:111 col 11: *c_CTRL-W*
 2 cmdline.txt:112 col 1: CTRL-W          Delete the |word| before the cursor.  This depends on the
 3 cmdline.txt:138 col 22: <C-C>).  A <BS> or CTRL-W could still end the command line
 4 cmdline.txt:171 col 8: CTRL-R CTRL-W                           *c_CTRL-R_CTRL-W* *c_<C-R>_<C-W>*
 5 cmdline.txt:177 col 4: CTRL-W  the Word under the cursor
 6 cmdline.txt:181 col 44: currently displayed match is used.  With CTRL-W the part of
 7 cmdline.txt:190 col 44: CTRL-R CTRL-R {0-9a-z"%#:-=. CTRL-F CTRL-P CTRL-W CTRL-A}
 8 cmdline.txt:191 col 44: CTRL-R CTRL-O {0-9a-z"%#:-=. CTRL-F CTRL-P CTRL-W CTRL-A}
 9 editing.txt:320 col 5: |CTRL-W_CTRL-F|.
10 eval.txt:1033 col 52: \<xxx>  Special key named "xxx".  e.g. "\<C-W>" for CTRL-W.  This is for use
11 eval.txt:2288 col 33: <               The number can be used with |CTRL-W_w| and ":wincmd w"
12 eval.txt:6489 col 39: accessed window is returned (where |CTRL-W_p| goes to).
13 eval.txt:6492 col 32: The number can be used with |CTRL-W_w| and ":wincmd w"
14 hebrew.txt:105 col 10: cursor.  CTRL-W and CTRL-U also work in the opposite direction.  <BS>, CTRL-W
15 index.txt:16 col 28: 2.2. Window commands                    |CTRL-W|
16 index.txt:91 col 4: |i_CTRL-W|      CTRL-W          delete word before the cursor
17 index.txt:210 col 2: |CTRL-W|        CTRL-W {char}      window commands, see |CTRL-W|
18 index.txt:502 col 27: 2.2 Window commands                                             *CTRL-W*
19 index.txt:506 col 2: |CTRL-W_CTRL-B| CTRL-W CTRL-B      same as "CTRL-W b"
20 index.txt:507 col 2: |CTRL-W_CTRL-C| CTRL-W CTRL-C      same as "CTRL-W c"
21 index.txt:508 col 2: |CTRL-W_CTRL-D| CTRL-W CTRL-D      same as "CTRL-W d"
22 index.txt:509 col 2: |CTRL-W_CTRL-F| CTRL-W CTRL-F      same as "CTRL-W f"
23 index.txt:510 col 3: CTRL-W CTRL-G      same as "CTRL-W g .."
-- More --

It is certainly not the same as searching just through the tags, but might be useful.

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.