Loading ...
Sorry, an error occurred while loading the content.
 

Nesting an already defined menu in a menu

Expand Messages
  • gvalkov
    Greetings, Is it possible to nest a menu that has already been defined (say, in a plugin) under another menu (say, PopUp)? Something like: amenu
    Message 1 of 4 , Jan 2 3:46 PM
      Greetings,

      Is it possible to nest a menu that has already been defined (say, in a
      plugin) under another menu (say, PopUp)?

      Something like:
      amenu PopUp.&SomeMenu :nest-another-menu MenuThatAlreadyExists

      I went through the docs as well as a bunch of plugins that deal with
      menus and basically found nothing.

      Thanks,
      G.

      --
      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
    • Marko Mahnič
      ... It is possible. In fact I implemented something like this in a plugin (FileType Menu) which was never published on vim.org. The code is here:
      Message 2 of 4 , Jan 3 2:30 AM
        On Jan 3, 12:46 am, gvalkov <georgi.t.val...@...> wrote:
        > Is it possible to nest a menu that has already been defined (say, in a
        > plugin) under another menu (say, PopUp)?

        It is possible. In fact I implemented something like this in a plugin
        (FileType Menu) which was never published on vim.org. The code is
        here:

        http://vimuiex.svn.sourceforge.net/viewvc/vimuiex/trunk/related/filetype-menu/

        From the docs:

        FileType Menu plugin implements a menu that changes its contents based
        on the 'filetype' of the current buffer.

        3. Moving menus around
        ======================
        The ftmenu plugin exposes some functions that enable the user to move
        a menu
        to a different location in the menu structure. This can be useful when
        many
        plugins are installed that create their own top-level menus which can
        make the
        menubar too large.

        Marko

        --
        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
      • gvalkov
        Neat module you have there. Thanks. Hm, I was also eyeing the output of `menu $menu` as a possibility, but it just seemed too painful to parse at the moment.
        Message 3 of 4 , Jan 4 3:55 PM
          Neat module you have there. Thanks.

          Hm, I was also eyeing the output of `menu $menu` as a possibility, but
          it just seemed too painful to parse at the moment. It would have been
          nice if vim had this built in - feels more like a core function,
          rather than something that scripts like yours should provide (imho).

          Either way, something like ftmenu#MoveMenu and ftmenu#CaptureMenu
          would be a nice addition to one of the vim script libraries (l9, tlib,
          vxlib etc)

          Thanks Again!

          On Jan 3, 12:30 pm, Marko Mahnič <marko.mah...@...> wrote:
          > On Jan 3, 12:46 am, gvalkov <georgi.t.val...@...> wrote:
          >
          > > Is it possible to nest a menu that has already been defined (say, in a
          > > plugin) under another menu (say, PopUp)?
          >
          > It is possible. In fact I implemented something like this in a plugin
          > (FileType Menu) which was never published on vim.org. The code is
          > here:
          >
          > http://vimuiex.svn.sourceforge.net/viewvc/vimuiex/trunk/related/filet...
          >
          > From the docs:
          >
          > FileType Menu plugin implements a menu that changes its contents based
          > on the 'filetype' of the current buffer.
          >
          > 3. Moving menus around
          > ======================
          > The ftmenu plugin exposes some functions that enable the user to move
          > a menu
          > to a different location in the menu structure. This can be useful when
          > many
          > plugins are installed that create their own top-level menus which can
          > make the
          > menubar too large.
          >
          > Marko

          --
          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
        • Marko Mahnič
          ... Yes, especially since the MoveMenu function has some problems with menus that contain some special characters, IIRC with | (bar). Most of the menus are
          Message 4 of 4 , Jan 5 1:58 AM
            On Jan 5, 12:55 am, gvalkov <georgi.t.val...@...> wrote:
            > Hm, I was also eyeing the output of `menu $menu` as a possibility, but
            > it just seemed too painful to parse at the moment. It would have been
            > nice if vim had this built in - feels more like a core function,
            > rather than something that scripts like yours should provide (imho).

            Yes, especially since the MoveMenu function has some problems with
            menus that contain some special characters, IIRC with '|' (bar). Most
            of the menus are transfered, though.

            >
            > Either way, something like ftmenu#MoveMenu and ftmenu#CaptureMenu
            > would be a nice addition to one of the vim script libraries (l9, tlib,
            > vxlib etc)

            I was planning to add it to VxLib (among other things), but I don't
            have much time these days.

            Marko

            --
            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
          Your message has been successfully submitted and would be delivered to recipients shortly.