3

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█
2
  • I switched back to longest,full. However, I'd like to understand the reasoning of this behavior. Commented Feb 10, 2017 at 18:48
  • 1
    See here, here and for a fix this patch Commented Feb 10, 2017 at 19:18

2 Answers 2

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...

2
  • 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. Commented Feb 10, 2017 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. Commented Feb 10, 2017 at 18:44
1

In case of someone want to find a solution to avoid the completion history. It just take much time to find this.

Use:

set wildmode=longest,full

Instead of:

set wildmode=longest:list,full

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.