Hello,

* On Fri, Jun 23, 2006 at 08:34:23AM -0700, Max Dyckhoff <[EMAIL PROTECTED]> 
wrote:
> If there are many values for the enum then I will generally jump to
> the tag and do as you do; copy the values and do an :s on them. What I
> was wondering though was basically "can I make vim insert every entry
> from the ^N popup menu?", which is listing all the values that I want
> to enter.

May be we can play with searchdecl() or ctags to get the definition of
the enum and then build the switch. 

See for instance 
<http://hermitte.free.fr/vim/ressources/vimfiles/ftplugin/c/c_switch-enum.vim>
(not yet part of lh-cpp.tar.gz)
(You will need a few other plugins of mine -> lh-map-tools.tar.gz and
word-tools.vim)

We can also imagine a interactive mode where the user selects the enum
values he is interested in, reorder them, and even tag the one he
wished to group (no "break;"). It can be done in a scratch buffer.

> Salman, your macros were certainly interesting, but they didn't seem to
> actually save any time. I can type "case:" as quickly as I can type
> ",case" :)

Well, it is always possible to have an imapping to <m-c>, or even
a context sensitive abbreviation that replace "case" with
"case:\n<+code+>\nbreak<++>;" outside string- and comment-contexts.

HTH,
-- 
Luc Hermitte
http://hermitte.free.fr/vim/

Reply via email to