VimCompletesMe icon indicating copy to clipboard operation
VimCompletesMe copied to clipboard

<S-Tab> completion

Open kurkale6ka opened this issue 8 years ago • 5 comments

Hi,

Is it currently possible to configure <S-Tab> to start completion in the opposite direction of <Tab>? So with let g:vcm_direction = 'n', <S-Tab> would start completion backwards.

kurkale6ka avatar Sep 27 '17 14:09 kurkale6ka

It does that already. Do you have something else mapped to Shift Tab?

ackyshake avatar Sep 28 '17 18:09 ackyshake

i <S-Tab> <Plug>vim_completes_me_backward

and an example:

find

f<(s-)tab> always proposes find first, never for

for

kurkale6ka avatar Sep 29 '17 08:09 kurkale6ka

I'm confused.

If I have the file as:

  1. foo
  2. bar
  3. find
  4. for
  5. f

and then type Shift-Tab after "f" on line 5, I get the popup. Then pressing Shift-tab again, the completion for "for" is selected.

Is that not what you're seeing or am I misunderstanding your question?

ackyshake avatar Sep 30 '17 00:09 ackyshake

The default behaviour for the plugin is to get the preceding word when using <tab>. <s-tab> should do the opposite. In your example 'foo' should be selected. Another one:

  1. foo
  2. f<tab> -> foo, f<s-tab> -> find
  3. find

kurkale6ka avatar Oct 04 '17 10:10 kurkale6ka

I see what you're saying now.

But, the plugin only uses the existing behavior of Ctrl-X_Ctrl-N/P. The vcm_direction variable, then, controls the selection direction inside the popup window.

In your previous example, if you had configured let g:vcm_direction = 'p', it would have selected "foo" after pressing shift-tab after "f" on line 2.

ackyshake avatar Oct 05 '17 03:10 ackyshake