Sublime Forum

Help! Need to remove weird hotkey not listed in menus, keymap files, or anywhere

#1

I’m not sure how this got added, or even where to find it to change it.

The default hotkey for the whole word button in the find/search UI is ⌥⌘W. However, when I press this shortcut, I can see from looking at the console that the following is being triggered instead.

command: find_manpage_from_selection

But after looking through every menu item in Sublime Text, in the Default (OSX).sublime-keymap, searching within open files/folders, and in /Library/Application Support/Sublime Text 3/, and doing a Spotlight search of my whole Mac for find_manpage_from_selection, I can’t seem to find it anywhere, nor can I figure out how to remove the hotkey from triggering it which is preventing me from using it to toggle the whole word button.

0 Likes

#2

Of course, not long after I posted this, I decided to try digging into some package files via Command Palette > PackageResourceViewer: Open Resource.

Upon opening the SublimeManpage package, and noticing it contained a Default (OSX).sublime-keymap file, I was pretty sure I found the culprit. After opening the file and seeing the keymapping for the find_manpage_from_selection command, I knew I had.

I saved a local copy of the keymap file for future reference, and just commented out the bindings it contains. Problem solved!

I’m still curious, though, how this hotkey override was able to work when I wasn’t even editing anything in the SublimeMandoc syntax, and when the sublime-keymap “file” only existed within the syntax package. Seems kinda like this shouldn’t happen.

0 Likes

#3

The thing that makes a keybinding apply or not apply is whether or not it has a context entry in it that specifies the conditions on which it should apply.

All key bindings files applied by all files are combined together into one list and the bindings take effect regardless of the package that they might have been contained in (otherwise the default key bindings would not work for any file type because the Default package defines no syntaxes, for example).

If a binding supposed to be specific to a type of file and it’s not, that would be a issue to raise with the package maintainer, who should either not apply default bindings at all and let the user set up what they need, or apply a context to the defaults so that they only apply in the correct places.

1 Like

#4

Good info. Thanks!

Hopefully whoever maintains the SublimeManpage package will change the hotkey to something that isn’t used by any other ST feature/command by default.

0 Likes