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

Re: Default binding for Cmnd-W

Expand Messages
  • björn
    ... Sorry, I was typing in a hurry...if you check :h macmenukey you ll see that it is used to set up the key combination you have to press to activate a menu
    Message 1 of 7 , Jan 17, 2008
      On 16/01/2008, David Morel <dmorel69@...> wrote:
      >
      >
      > Le 16 janv. 08 à 10:24, björn a écrit :
      > >
      > > Just quickly: the problem is that <D-w> is bound to a menu item and
      > > such bindings override normal :map commands (check :h macmenukey). I
      > > suggest you add the following to your .gvimrc
      > >
      > > macmenukey <D-w>
      > > map <D-w> :bd<cr>
      > > imap <D-w> <C-o>:bd<cr>
      > >
      > > or simply
      > >
      > > macmenukey <D-w> :bd<cr>
      >
      > I ended up using the first form you proposed:
      >
      > " Make the cmnd-w key close the buffer, not the window
      > macmenukey File.Close
      > no <D-w> :bd<cr>
      > ino <D-w> <Esc>:bd<cr>
      >
      > Works like a charm, thanks a lot!
      >
      > Couldn't make the second one work, though, but -to me- that's np.

      Sorry, I was typing in a hurry...if you check ":h macmenukey" you'll
      see that it is used to set up the key combination you have to press to
      activate a menu item. So

      macmenukey File.Close <D-w>

      associates the "File.Close" menu item with <D-w> (which is already
      done in $VIM/gvimrc). Now, to change the actual binding you have to
      use the "menu" commands in Vim. Something like

      aunmenu File.Close
      amenu File.Close :bd<cr>

      should do what you were asking for (":amenu" does the right thing in
      insert mode that you were doing manually with the ":map" commands, if
      I'm not mistaken).

      Anyway, since you already have it working I guess you can ignore all that... :-)

      /Bjorn

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.