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

menu for buffers of specific filetype

Expand Messages
  • Maxim Kim
    Hi, What is the vim way to define filetype(or buffer) specific menus? I want a menu to be available only in buffers of my filetype. For mappings I usually use
    Message 1 of 3 , Feb 9 1:02 AM
    • 0 Attachment
      Hi,

      What is the vim way to define filetype(or buffer) specific menus?
      I want a menu to be available only in buffers of my filetype.
      For mappings I usually use <buffer> but couldn't find it for :menu
      command.

      There is 'disable' exists though. But as far as I can see it needs
      autocommands to set menus disabled/enabled depending on buffer. Is it
      the only way?

      Maxim.

      --
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
    • Tony Mechelynck
      ... I m surprised that there was no answer to this post in almost two months. Yes, in Vim the only way to detect that a buffer has been entered or left is by
      Message 2 of 3 , Apr 4, 2010
      • 0 Attachment
        On 09/02/10 10:02, Maxim Kim wrote:
        > Hi,
        >
        > What is the vim way to define filetype(or buffer) specific menus?
        > I want a menu to be available only in buffers of my filetype.
        > For mappings I usually use<buffer> but couldn't find it for :menu
        > command.
        >
        > There is 'disable' exists though. But as far as I can see it needs
        > autocommands to set menus disabled/enabled depending on buffer. Is it
        > the only way?
        >
        > Maxim.
        >

        I'm surprised that there was no answer to this post in almost two months.

        Yes, in Vim the only way to detect that a buffer has been entered or
        left is by means of autocommands. Since you want to take some action
        (modify the menus, which in Vim are normally global) depending on which
        buffer is current, you would have to harness some autocommand events,
        probably BufEnter and BufLeave.


        Best regards,
        Tony.
        --
        If all the Chinese simultaneously jumped into the Pacific off a 10 foot
        platform erected 10 feet off their coast, it would cause a tidal wave
        that would destroy everything in this country west of Nebraska.

        --
        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

        To unsubscribe, reply using "remove me" as the subject.
      • Maxim Kim
        ... Thanks, Tony. I use those 2 (plus BufHidden) autocomands to enable/disable menus since the first letter. Maxim. -- You received this message from the
        Message 3 of 3 , Apr 4, 2010
        • 0 Attachment
          On 5 апр, 08:44, Tony Mechelynck <antoine.mechely...@...> wrote:
          > I'm surprised that there was no answer to this post in almost two months.
          >
          > Yes, in Vim the only way to detect that a buffer has been entered or
          > left is by means of autocommands. Since you want to take some action
          > (modify the menus, which in Vim are normally global) depending on which
          > buffer is current, you would have to harness some autocommand events,
          > probably BufEnter and BufLeave.
          >
          > Best regards,
          > Tony.

          Thanks, Tony.
          I use those 2 (plus BufHidden) autocomands to enable/disable menus
          since the first letter.

          Maxim.

          --
          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

          To unsubscribe, reply using "remove me" as the subject.
        Your message has been successfully submitted and would be delivered to recipients shortly.