gelguy / Cmd2.vim

cmdline-mode enhancement for Vim
MIT License
94 stars 4 forks source link

Breaks :h :e etc. #11

Closed justrajdeep closed 8 years ago

justrajdeep commented 8 years ago

Hi

If i enable it with

cmap <expr> <Tab> Cmd2#ext#complete#InContext() ? "\<Plug>(Cmd2Complete)" : "\<Tab>"

And then try

:e <TAB>

it just prints ^I

gelguy commented 8 years ago

Cmd2Complete only works for / and ? search mode. To prevent :e <Tab> from printing ^I, you have to set wildcharm=<Tab> and it will default to the normal wildmode.

To use Cmd2 with :, you have to use Cmd2Suggest.

justrajdeep commented 8 years ago

Hi GelGuy

I have the following in my .vimrc

 let g:Cmd2_options = {
      \ '_complete_ignorecase': 1,
      \ '_complete_uniq_ignorecase': 0,
      \ '_complete_fuzzy': 0,
      \ }

cmap <expr> <Tab> Cmd2#ext#complete#InContext() ? "\<Plug>(Cmd2Complete)" : "\<Tab>"

set wildcharm=<Tab>

I also have set in my .vimrc

wildchar=<TAB>

Would that create an issue?

EDIT: just to clarify it works perfectly with :%s, / and ?

gelguy commented 8 years ago

The : mode is not available using <Plug>(Cmd2Complete), since it will just be a reimplementation of wildmenu.

Do you have wildmenu enabled with set wildmenu? If you do not, then ^I appearing is Vim's standard behaviour.

If you want : completion, you have to use Cmd2Suggest which provides autocompletion as you type. : mode is still experimental so there might be some bugs.

justrajdeep commented 8 years ago

Hi GelGuy

i have wildmenu set in my .vimrc

In fact i have

set wildmode=list:longest,full

i dont want : completion, i want to default it to vim wildmenu. Just curious how it works for :%s?

gelguy commented 8 years ago

Cmd2#ext#complete#InContext() checks if the commandline is in /, ? or :s context.

I am unable to reproduce this issue. There might be another mapping conflicting with <Tab>.

Use :verbose cmap <Tab> to check.

Otherwise provide a minimal .vimrc, together with your Vim version, terminal or GUI and OS.

justrajdeep commented 8 years ago

Hi GelGuy I figured out the issue. I had the below mapping in my .vimrc

set wcm=<C-Z>

because it was abbreviated wcm i did not realize it was wildcharm. That was causing all the issues. Now the plugin works like a charm.

Sorry for all the trouble.