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

Re: RFE: :amap and :menu

Expand Messages
  • Bram Moolenaar
    ... Both are in the todo list. :amap would not be terrible difficult to implement. buffer-local menus are complicated. What about menus that are not for the
    Message 1 of 5 , Nov 9, 2006
      Benji Fisher wrote:

      > Maps and menus work in much the same way, and when writing a vim
      > script (especially an ftplugin) I like to make a menu item corresponding
      > to each key map that I define. Unfortunately, there are two ways that
      > maps and menus differ:
      >
      > 1. There is an :amenu command (and also :anoremenu), but there is no
      > :amap command (nor :anoremap).
      >
      > 2. I can make buffer-local maps with :map <buffer>, but :menu <buffer>
      > does not work.
      >
      > Both of these shortcomings can be overcome with scripting, but it
      > would be more convenient and more consistent if :amap and :menu <buffer>
      > were both implemented.

      Both are in the todo list.

      ":amap" would not be terrible difficult to implement.

      buffer-local menus are complicated. What about menus that are not for
      the current buffer, hide them? Would make jumping between buffers very
      slow.

      --
      What is the difference between a professional and an amateur?
      The ark was built by an amateur; professionals gave us the Titanic.

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ download, build and distribute -- http://www.A-A-P.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
    • Benji Fisher
      ... I neglected to check. Maybe I need to update my todo list: I see a remark about buffer-local menus, but nothing about :amap. ... I will try deleting and
      Message 2 of 5 , Nov 10, 2006
        On Thu, Nov 09, 2006 at 08:14:41PM +0100, Bram Moolenaar wrote:
        >
        > Benji Fisher wrote:
        >
        > > Maps and menus work in much the same way, and when writing a vim
        > > script (especially an ftplugin) I like to make a menu item corresponding
        > > to each key map that I define. Unfortunately, there are two ways that
        > > maps and menus differ:
        > >
        > > 1. There is an :amenu command (and also :anoremenu), but there is no
        > > :amap command (nor :anoremap).
        > >
        > > 2. I can make buffer-local maps with :map <buffer>, but :menu <buffer>
        > > does not work.
        > >
        > > Both of these shortcomings can be overcome with scripting, but it
        > > would be more convenient and more consistent if :amap and :menu <buffer>
        > > were both implemented.
        >
        > Both are in the todo list.

        I neglected to check. Maybe I need to update my todo list: I see
        a remark about buffer-local menus, but nothing about :amap.

        > ":amap" would not be terrible difficult to implement.
        >
        > buffer-local menus are complicated. What about menus that are not for
        > the current buffer, hide them? Would make jumping between buffers very
        > slow.

        I will try deleting and refreshing them with autocommands and see
        how slow it is. Off hand, I would say hide them: I do not want to
        waste menu space on TeX-related items when I am editing another file
        type.

        --Benji Fisher
      • Benji Fisher
        ... Thanks. I had forgotten about the :menu disable option. The disadvantage is that if I have several different file types open, each with its own
        Message 3 of 5 , Nov 10, 2006
          On Thu, Nov 09, 2006 at 12:37:48PM -0700, Christian J. Robinson wrote:
          > On Thu, 9 Nov 2006, Bram Moolenaar wrote:
          >
          > > buffer-local menus are complicated. What about menus that are not
          > > for the current buffer, hide them? Would make jumping between
          > > buffers very slow.
          >
          > When I've defined menus that are only applicable to a buffer or a
          > filetype I've just defined autocommands that does an :amenu disable on
          > BufLeave and :amenu enable on BufEnter. I've found this is usually
          > the best compromise and in fact has some advantages; it can be
          > confusing and otherwise problematic to have menu items, or entire
          > menus--especially toplevel menus--disappear and reappear.
          >
          > - Christian

          Thanks. I had forgotten about the ":menu disable" option. The
          disadvantage is that if I have several different file types open, each
          with its own top-level menu, then my menu bar will be crowded with
          disabled menus.

          --Benji Fisher
        Your message has been successfully submitted and would be delivered to recipients shortly.