Tuesday, January 12, 2016

How to complete popup as I type

I am trying to use complete() in vim so that it reads the value as well.

For example, from vim's complete() example,

inoremap <F5> <C-R>=ListMonths()<CR>

func! ListMonths()
call complete(col('.'), ['January', 'February', 'March',
\ 'April', 'May', 'June', 'July', 'August', 'September',
\ 'October', 'November', 'December'])
return ''
endfunc

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.

Regards,
Rudra

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

Post a Comment