Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to unbind a key binding in Sublime Text 2?

I have a habit of hitting CTRL+T to open a new tab in ST2. However this invokes the transpose function. I could map the new_file command to CTRL+T, but is it possible to disable the command completely via user keymap file. My search suggested adding this to user keymap.

[ { "keys": ["ctrl+t"], "command": "unbound" } ] 

Is the "unbound" an officially endorsed way of disabling a shortcut?

like image 967
user Avatar asked Oct 08 '13 10:10

user


People also ask

How do I change key bindings in Sublime Text?

Users can customize their key bindings by creating a file named Default. sublime-keymap in their Packages/User/ directory. For example, the following will create a key binding to show unsaved changes, if any exist, via Ctrl+Shift+`.

How do I change my default key bindings?

The only way to change default key bindings is to edit the settings. json file. To change default key bindings, open the Settings page and select Actions from the sidebar.

How do I open a keymap file in sublime?

Key maps of the corresponding platform will be loaded in the Sublime Text editor. A user can open the keymap file or default key bindings using the option Preferences → Key Bindings.


1 Answers

{ "keys": ["ctrl+-"], "command": "noop" }

Binding a key to a no-operation or anything which wouldn't carry a command behavior, such as "hello", should work.

This would also keep the body of the binding if you change your mind in the future.

like image 59
Mehrad Avatar answered Sep 22 '22 04:09

Mehrad