Tuesday, January 12, 2016

Re: How to complete popup as I type

Hi,


> I am trying to use complete() in vim so that it reads the value as
> well.
>
> For example, from vim's complete() example,
> [...]
>
> if I type <F5> I will get all the months as a pop up. Now, what I
> want is, if I type "J", only January, June and July will be shown,
> "Ju" will give June and July, and so on.
>
> I read the vim-doc, and tried complete_check, but that's not.
>
> Also, I have tried to use omnicomplete example E839 in vimdoc, but I
> cant properly call it, always getting invalid argument error.
>
> Please suggest me the the preferred method of menu with completion as
> I type, and how to use that.

Last December, I tried to follow the documentation to implement a dynamic completion as well.
Alas I didn't succeed. I suspect either a bug in vim or an invalid documentation regarding completion "third mode" and so on.

Correct me if I'm wrong.


In the end I've "found" a workaround. It consists in:
- listening to CursorMoveI to detect the end of the completion mode (and to restart the completion mode otherwise) ;
- and in using feedkey to force the restart of the completion mode after each key typed.

You'll find more complete code and explanations on http://vi.stackexchange.com/questions/5820/dynamic-completion/5935#5935

HTH,

--
Luc Hermitte

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: