1

Starting vim (8.0) with an empty .vimrc, or as vim -u /dev/null. Executing:

:set nocompatible
:set wildmode=list

On the screen:

:e .config/█

I always thought that what happens when you press Tab is the result of my statusline or laststatus, but changing those do not affect the result:

:e .config/
alot/
aurgetrc
aurvote
awesome/
compton.conf
:e .config/█

Notice the duplicated :e .config/ at the top.

The command line is still in the bottom, and what happens next when I type a and press Tab falls beyond by comprehension:

:e .config/
alot/
aurgetrc
aurvote
awesome/
compton.conf
:e .config/a
alot/     aurgetrc  aurvote   awesome/
:e .config/a█

It keeps the whole command line completion history for each Tab press. Further:

:e .config/
alot/
aurgetrc
aurvote
awesome/
compton.conf
:e .config/a
alot/     aurgetrc  aurvote   awesome/
:e .config/au
aurgetrc  aurvote
:e .config/au█

Needless to say that if I remove au hitting Backspace, and then press Tab again, even more lines are added.

I expect to see command line and wild menu displaying very recent list of completion options when Tab is pressed. How can this be done?

aurgetrc  aurvote
:e .config/au█
1

Not an entire solution, but I haven't figured out the last part yet.

AFAIK there's no way to clear the screen except by finishing the command or cancelling it. So let's try with a mapping instead:

:cnoremap <S-Tab> <C-c>:<Up>

This will cancel the current command, clearing the screen, and loading it again in the command line.

Note: I tried to also restart the completion with <Tab> but the tab char was inserted instead...

  • 1
    It seems to me that in command line mode completion cease to work if there is colon or angle brackets, and it inserts ^I. – phil pirozhkov Feb 10 '17 at 18:35
  • 1
    Tried to work this around by setting a different wildchar to Z, it just inserts Z. Changing <C-c> to <Esc> doesn't help. Changing <Up> to <C-p> doesn't help either. – phil pirozhkov Feb 10 '17 at 18:44

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.