I developed "completeselect" option feature in Vim.
It determines how to select candidate in ins-completion.
The possible values are:
0 select and insert first candidate
1 select first candidate but not insert
2 no selected candidate
I think it is good change for completion.
I tested it in Vim 7.3.1036 and it worked fine.
How do you think about this feature?
Thanks. I added it.
> It forces the user to look into the completion menu before continue typing.
Yes.
> Can you try providing use cases when which option is likely to be
preferred by users? Eg when do you want option "no selecetd candidate" ?
And this feature is useful for implementing auto completion plugin.
I implemented some auto completion plugins.
https://github.com/Shougo/neocomplete.vim
https://github.com/Shougo/neocomplcache.vim
And there are other completion plugins like YouCompleteMe.
https://github.com/Valloric/YouCompleteMe
They uses feedkeys() function like below.
call feedkeys( "\<C-X>\<C-U>\<C-P>", 'n' )
But default completion behavior(<C-x><C-u>) is annoying for me.
Because first candidate is selected automatically.
If the option is added, we can implement auto completion more easier.
From your description, I think I'd rather see this as an additional value or values supported in 'completeopt'. Currently the only control over what gets inserted is "longest". If it's there, only part of the match text gets inserted, otherwise, the whole first match gets inserted. Why not add a "noinsert" or something, and maybe a "noselect"?
I.e., you could make the list at :help 'completeopt' look like:
menu Use a popup menu to show the possible completions. The
menu is only shown when there is more than one match and
sufficient colors are available. |ins-completion-menu|
menuone Use the popup menu also when there is only one match.
Useful when there is additional information about the
match, e.g., what file it comes from.
longest Only insert the longest common text of the matches. If
the menu is displayed you can use CTRL-L to add more
characters. Whether case is ignored depends on the kind
of completion. For buffer text the 'ignorecase' option is
used.
preview Show extra information about the currently selected
completion in the preview window. Only works in
combination with "menu" or "menuone".
noinsert Do not insert any text for a match until the user selects a
match from the menu. Only works in combination with "menu"
or "menuone". No effect if "longest" is present.
noselect Do not select a match in the menu, force the user to select
one from the menu. Only works in combination with "menu" or
"menuone".
Thank you for the suggestion.
I updated the patch to extend completeopt.
Can you try it?
Sorry, missed this part of the discussion when writing my previous reply.
--
--
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.