Stop Alt key bringing up the menu in Sublime Text 2

后端 未结 2 440
-上瘾入骨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.

    0 讨论(0)
  • 2021-02-06 14:21

    If you use Autohotkey, you can try to use #IfWinActive which will only apply hotkeys if a certain windows is active. Then your code would look something like this

    #IfWinActive, Emacs ; the name of the window
    ~LAlt::return ;this enables the LAlt + hotkey action but disables LAlt
    LAlt & space::tooltip,do stuff
    ...
    #IfWinActive ;end
    
    0 讨论(0)
提交回复
热议问题