Alan Briolat wrote:

On Wed, 19 Apr 2006 14:25:42 +0800
Linsong <[EMAIL PROTECTED]> wrote:

Alan Briolat wrote:

On Wed, 19 Apr 2006 11:51:31 +0800
Linsong <[EMAIL PROTECTED]> wrote:



Hi,
  I have tried the omni competion, it is very cool!
But there is still one thing that I think is not very convenient. For example, when I input part of a function name(foobar):
    foo|  (| is the position of the cursor)
then I invoke the omnicompletion by pressing <C-X><C-O>, consider the completion list like this: fooblah
    fooblahblah
    fooblahblah
    foobar
    ...
    ...

then the strings inputed will be replaced by the first matched item(here it is fooblah). If I want to get foobar, I need to press <C-N> several times. It is not very convenient. I think it would be better like the following: After <C-X><C-O>, the inputed string will not be replaced, only the completion menu shows up, then I can choose the item that I want by pressing <C-N>; Or, I can go on to input more characters and the completion menu will update its menu items based on the new input when I input. So the items in completion menu will become less and less and it is easier to select the matched item. Inputing more characters is better than pressing <C-N> several times.
I *believe* this is the purpose of <C-X><C-O><C-P> (someone please correct me
if I am wrong...)


Yes, that is just what I mean. I need to go over the online help :)
Do you know how to make it as the default action, that is make <C-X><C-O> works like <C-X><C-O><C-P>?

Well, what I do is map a different key sequence to it.  My preference (doesn't
work in terminals though) is:
:imap <C-space> <C-X><C-O><C-P>

There appears to be only one problem with using <C-X><C-O><C-P>, which is that
it makes omni-complete useless when there is only one match (doesn't replace,
and doesn't give a list of options). If someone knows how to overcome this,
please let me know :(
I suggest vim to provide a option that don't modify the inputed character when pressing <C-X><C-O>.

BR
Vincent

Reply via email to