Enhancement request for vim omni completion feature

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Enhancement request for vim omni completion feature

Sean-130

Hello,

The new vim omni completion is great. It can even be used to make an
independent IM (input method), as I showed on
http://maxiangjiang.googlepages.com/ChineseIM.gif

It would be nice if we can have a "label" before each item on the
popup menu, so that we can get the value simply by typing "3" or "8"
etc, instead of endless <C-N><C-N><C-N> ...

Is it possible?

Thanks

Sean
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Enhancement request for vim omni completion feature

Tony Mechelynck

On 07/01/09 20:46, Sean wrote:

> Hello,
>
> The new vim omni completion is great. It can even be used to make an
> independent IM (input method), as I showed on
> http://maxiangjiang.googlepages.com/ChineseIM.gif
>
> It would be nice if we can have a "label" before each item on the
> popup menu, so that we can get the value simply by typing "3" or "8"
> etc, instead of endless<C-N><C-N><C-N>  ...
>
> Is it possible?
>
> Thanks
>
> Sean

IIRC, you can select any pum line by mouse-clicking (if, of course, you
are either in the GUI or in a Console Vim application able to get mouse
events in your current terminals -- this may mean +mouse_xterm in an X
terminal emulator, or +mouse_gpm _and_ the GPM daemon running if you're
in the Linux text console. To see if your current Vim supports your
current mouse:

        :echo has('mouse')
If the answer is zero, you have no mouse support at all in this Vim.

        :set mouse=a
        F1
You should see the first page of help. Double-click |bars| on the right
side, somewhat below the hjkl diamond. You should see the help change.
To come back, use Ctrl-RightMouse, or, if that doesn't work, g RightMouse.


Best regards,
Tony.
--
My mother loved children -- she would have given anything if I had been
one.
                -- Groucho Marx

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Enhancement request for vim omni completion feature

Yue Wu

On Thu, 08 Jan 2009 07:33:56 +0800, Tony Mechelynck  
<[hidden email]> wrote:

>
> On 07/01/09 20:46, Sean wrote:
>> Hello,
>>
>> The new vim omni completion is great. It can even be used to make an
>> independent IM (input method), as I showed on
>> http://maxiangjiang.googlepages.com/ChineseIM.gif
>>
>> It would be nice if we can have a "label" before each item on the
>> popup menu, so that we can get the value simply by typing "3" or "8"
>> etc, instead of endless<C-N><C-N><C-N>  ...
>>
>> Is it possible?
>>
>> Thanks
>>
>> Sean
>
> IIRC, you can select any pum line by mouse-clicking (if, of course, you
> are either in the GUI or in a Console Vim application able to get mouse
> events in your current terminals -- this may mean +mouse_xterm in an X
> terminal emulator, or +mouse_gpm _and_ the GPM daemon running if you're
> in the Linux text console. To see if your current Vim supports your
> current mouse:
>
> :echo has('mouse')
> If the answer is zero, you have no mouse support at all in this Vim.
>
> :set mouse=a
> F1
> You should see the first page of help. Double-click |bars| on the right
> side, somewhat below the hjkl diamond. You should see the help change.
> To come back, use Ctrl-RightMouse, or, if that doesn't work, g  
> RightMouse.
>
>
> Best regards,
> Tony.

This is a feature request for selecting by number key of keyboard,
not try to find an alternative way :)

This feature is useful to let ChineseIM behave more similar with
other normal IMs. And, when you typing, why bother to move your hand away
 from keyboard and use mouse to select it then move hand back?
That's not the vim way.

--
Regards,
Van.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Enhancement request for vim omni completion feature

MarcWeber

> This is a feature request for selecting by number key of keyboard,
> not try to find an alternative way :)
>
> This feature is useful to let ChineseIM behave more similar with
> other normal IMs. And, when you typing, why bother to move your hand away
>  from keyboard and use mouse to select it then move hand back?
> That's not the vim way.
SuperTab manages to map <tab> to <c-n> somehow..  Maybe one can map
something to multiple <c-n> as well then?

Sincerly
Marc Weber

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Enhancement request for vim omni completion feature

Sean-130

> > This is a feature request for selecting by number key of keyboard,
> > not try to find an alternative way :)
>
> > This feature is useful to let ChineseIM behave more similar with
> > other normal IMs. And, when you typing, why bother to move your hand away
> >  from keyboard and use mouse to select it then move hand back?
> > That's not the vim way.
>
> SuperTab manages to map <tab> to <c-n> somehow..  Maybe one can map
> something to multiple <c-n> as well then?
>
> Sincerly
> Marc Weber

We have a workaround, by mapping number keys only when popup menu is
visible.
It works great:  http://maxiangjiang.googlepages.com/vimim.gif

Thanks

Sean

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

mea
Reply | Threaded
Open this post in threaded view
|

Re: Enhancement request for vim omni completion feature

mea

On 22:18 Mon 19 Jan     , Sean wrote:
>
> > > This is a feature request for selecting by number key of keyboard,
> > > not try to find an alternative way :)

> We have a workaround, by mapping number keys only when popup menu is
> visible.
> It works great:  http://maxiangjiang.googlepages.com/vimim.gif
>
> Thanks
>
> Sean

This is really great! I want to have it too! How do you do it?

Best regards

Martin

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Enhancement request for vim omni completion feature

Sean-130



On Jan 19, 3:07 pm, Martin <[hidden email]> wrote:

> On 22:18 Mon 19 Jan     , Sean wrote:
>
>
>
> > > > This is a feature request for selecting by number key of keyboard,
> > > > not try to find an alternative way :)
> > We have a workaround, by mapping number keys only when popup menu is
> > visible.
> > It works great:  http://maxiangjiang.googlepages.com/vimim.gif
>
> > Thanks
>
> > Sean
>
> This is really great! I want to have it too! How do you do it?
>
> Best regards
>
> Martin


Please take a look at
http://maxiangjiang.googlepages.com/vimim.html

No problem if you don't understand Chinese. Just check the pictures,
and follow the first or 2nd link to get the code.  The code looks
like  (around line 452)

-----------------------------------------------------------
        for word in oneline_list
            let complete_items = {}
            let abbr = printf('%2s',label) . "\t" . word
            let complete_items["word"] = word
            if g:vimim_enable_number_label ||
g:vimim_popup_label_start
                let complete_items["abbr"] = abbr
            endif
            let complete_items["menu"] = menu
            let complete_items["dup"] = 1
            let label = label + 1
            call add(popupmenu_list, complete_items)
        endfor
-----------------------------------------------------------







--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---