Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supertab doesn't work in command-line window #199

Closed
mimooh opened this issue May 16, 2018 · 4 comments
Closed

Supertab doesn't work in command-line window #199

mimooh opened this issue May 16, 2018 · 4 comments

Comments

@mimooh
Copy link

mimooh commented May 16, 2018

After going to command-line window via q: the completion is gone. Any ideas?

@ervandew
Copy link
Owner

Hmm, seems to work fine for me. Do you have paste (:set paste?) enabled in your command window?

@mimooh
Copy link
Author

mimooh commented May 16, 2018 via email

@mimooh
Copy link
Author

mimooh commented May 20, 2018

I figured it out somewhat. Fist thing is that we may use different compilations of vim:

"When Vim was compiled without the +cmdline_compl feature only file names,
directories and help items can be completed. The number of help item matches
is limited (currently to 300) to avoid a long delay when there are very many
matches."

I finally noticed I have this behaviour for :imap <Tab>
In a normal window:

i  <Tab>         <Plug>SuperTabForward

In the command line window:

i  <Tab>        @<C-X><C-V>
i  <Tab>         <Plug>SuperTabForward

Then I found the exactly same, unresolved problem that I face:
https://groups.google.com/forum/#!topic/vim_use/EX93BOy4XZM/discussion

QUOTE
I am trying to disable the default mapping for the tab key to @A in command window. according to :h command-line-window, adding the following two lines in .vimrc should do the job but it doesn't to my test.
au CmdwinEnter [:>] iunmap
au CmdwinEnter [:>] nunmap
below is the min repo vimrc I observed this behavior.
set nocompatible
au CmdwinEnter [:>] iunmap
au CmdwinEnter [:>] nunmap

once in command window (either by : then ctrl-f, or q: in normal mode), :map still shows "n @A", which conflicts/overwrites my other mapping for the tab key.

set wildchar= seems to avoid the default mapping, but I do want to use tab for auto-completion in vim. I also tried tightening the scope of non-tab wildchar with
au CmdwinEnter [:>] set wildchar=
au CmdwinLeave [:>] set wildchar=
but this doesn't work either.

meanwhile, with vim help recommended setting, I always got this error on entering command window:
Error detected while processing CmdwinEnter Auto commands for "[:>]":
E31: No such mapping
Press ENTER or type command to continue

it feels like by the time CmdwinEnter is triggered, the default tab mapping is not injected yet, and somehow it comes in at a later phase, but still before my "set wildchar=" takes effect, which is really confusing.

how can I disable them permanently? I am on vim 8.0.1420. thanks.
END OF QUOTE

@mimooh
Copy link
Author

mimooh commented May 20, 2018

As inspect it further, I can see that <S-Tab> is not affected by this, as I understand, broken vim behaviour. So this solves the issue for me: I will go with shift tab always.

@mimooh mimooh closed this as completed May 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants