Stop Alt key bringing up the menu in Sublime Text 2

后端 未结 2 497
-上瘾入骨i
-上瘾入骨i 2021-02-06 13:38

I\'m an Emacs user looking into Sublime Text 2. I\'ve remapped the default Emacs key bindings and have become accustomed to moving about using Alt+i, Alt+k, Alt+j, Alt+l for up,

2条回答
  •  没有蜡笔的小新
    2021-02-06 14:16

    The problem I was having was that a key I was rebinding conflicted with a mnemonic on the menu. Specifically, I had Alt+i mapped to something while it was also the mnemonic for Find.

    To fix the problem I removed the mnemonics from the menu, which stopped the menu appearing. To do this go to Preferences -> Browse Packages and open the Default/Main.sublime-menu file. In there you can remove all of the "mnemonic": "*", lines to get rid of the mnemonics.

    Pressing the alt key will still bring up the menu. If you want to disable this you can use the following AutoHotkey script (thanks Armin):

    SetTitleMatchMode RegEx
    #IfWinActive .*Sublime Text 2.*
        LAlt & esc::return ;This can be any key, not just escape. It's needed to get AutoHotkey to treat Alt as a prefix key.
        ~LAlt::return
    #IfWinActive
    

    This only stops left Alt bringing up the menu, right Alt will still work as usual.

提交回复
热议问题