Sublime Forum

How to remove default keyboard shortcut (mac)

#1

I successfully added a shortcut by adding this to my user keymap file:

[ { "keys": ["ctrl+;"], "command": "auto_complete" } ]

But now I just have both the old and new shortcut I’d like to remove the old one, but the aparent file path of the default keymap file (/Users/Matt/Library/Application Support/Sublime Text 3/Packages/Default/Default (OSX).sublime-keymap) does not even exist on my computer. When I try to “reveal in finder” it brings me to my packages folder, which does not contain a folder “default”. Also, when I try to save the file I get the error:

Unable to save ~/Library/Application Support/Sublime Text 3/Packages/Default/Default (OSX).sublime-keymap Error: No such file or directory.

0 Likes

#2

Based on your problem description, I assume what you’re saying here is that you want auto_complete to trigger on Ctrl+; and not Ctrl+Space.

The reason you can’t see the contents of the Default package is because it is a package that ships with Sublime text and is stored in a different format and location than the packages that you manually install.

While you can create an override for Default/Default (OSX).sublime-keymap that’s not a good idea because your override will mask the built in key map, so if a future build of Sublime adds new commands and bindings, they’ll be hidden from you. That’s why the left hand pane in the key binding window shows you the content of the file but doesn’t let you edit it.

In order to stop Ctrl+Space from doing anything, you can add a mapping for it to a command that doesn’t do anything, to mask what the default binding for the same key is doing:

[
    { "keys": ["ctrl+;"], "command": "auto_complete" },
    { "keys": ["ctrl+space"], "command": "noop" }
]

Here noop is a command that doesn’t exist; when you try to execute a command that Sublime does not recognize it silently does nothing.

2 Likes

#3

Interesting! Thanks for the idea, but it does not solve my problem. You see, I changed the global shortcut for the Mac char/emoji picker to control-space. Setting { "keys": ["ctrl+space"], "command": "noop" } still prevents my global hotkey from coming through.

0 Likes