Sublime Forum

Alt+[menubar mnemonic] conflicts with keybindings in linux

#1

Having searched the forum for +linux +keybinding* +menu* turned up nothing on this issue, so here is creating a new one!

This is a particularly frustrating issue in Linux, especially when trying to use a package like Alternate Vim, which defines alt+i to move the cursor up a line – but this also opens the find menu. In Windows the package and user-defined key bindings take precedence over menu-mnemonic bindings.

I have found a somewhat hacky work-around.

I have a sublime text package called “SubRed” which has a file “Main.sublime-menu” (it’s in .config/sublime-text-3/Packages/SubRed - I manually installed the package).

To disable the menubar I do:

  1. ctrl+shift+p view: toggle menu (which does not disable the menu by itself for some reason),
  2. open the Main.sublime-menu file in sublime,
  3. save it.

Then voila, the menu bar is gone and I can finally use my Alternate Vim package key bindings without conflicting with the alt+[menubar mnemonic].

To get the menu bar back if needed: ctrl+shift+p view: toggle menu.

The ideal solution would be to not have to disable the menubar, but get it to work like windows where user or package defined st3 keybindings take precedence over default or system bindings including alt+[menubar mnemonic]. But where opening menus in the menu bar is still possible with the old binding in sequence – e.g., “alt, i”.

If anyone could suggest a better solution based on this (or otherwise) I (and I’m sure many many people) would appreciate it!

0 Likes

#2

FWIW, you can override almost any menu item’s properties with a menu file in your User package.

Create “User/Main.sublime-menu” with the following content:

    {"id": "find", "mnemonic": ""}
]
0 Likes

#3

I create User/Main.sublime-menu file → I insert

[{
    "id": "edit",
    "mnemonic": "л"
}]

and save file. But Alt+л not worked for me. I see in console:

warning: mnemonic л not found in menu caption Edit

See also: Support non-English mnemonic characters.

Thanks.

0 Likes

#4

I guess that means the mnemonic has to be in the caption, so you need to override the caption too

maybe try:

[{
    "id": "edit",
    "mnemonic": "л",
    "caption": "Edit (л)"
}]
1 Like