0

I want to map <M-h> to in insert mode. I add imap <M-h> <Left> to .vimrc.
But if I press <M-h>, Help menu will pop up. How to disable this and force <M-h> to in insert mode?

enter image description here

Fisher
  • 1,086
  • 2
  • 13
  • 28

4 Answers4

1

This is probaby what you want: :imenu disable Help

tivn
  • 2,011
  • 1
  • 12
  • 10
1

Found a way: remove the menu bar :set guioptions -=m.

Thanks below link.
How to hide the menu/tool bar of gvim?

Fisher
  • 1,086
  • 2
  • 13
  • 28
1

The default gvim menus are located at $VIMRUNTIME/menu.vim. You can copy this file into your local vim settings, disable loading of the default menus with :let did_install_default_menus=1 in your .vimrc (see :help menu.vim), and then source the copy which you will edit. You'll notice that the commands to add the Help menus (like :an 9999.10 &Help.&Overview<Tab><F1> :help<CR>) have ampersands before the 'H' in 'Help'; this ampersand decides shortcut keys. You could then change the shortcut key, or remove it altogether while still retaining the Help menu.

brhfl
  • 294
  • 2
  • 8
1

Alt key is in competition between mappings and menus.

To choose which one has the priority, you'll need to set 'winaltkeys'. Set it to no in order to completely ignore menu alt-shortcuts.

This solution is less intrusive than the one where menu bar is completely removed. The menu is still displayed, we just loose the shortcuts.

Luc Hermitte
  • 17,351
  • 1
  • 33
  • 49