Sublime Forum

How Do I Override Default Key Bindings in Linux?

#1

How do I override default key bindings? I need to override the Ctrl+Shift+U (Soft Redo) key binding because it conflicts with the Unicode character code input shortcut on Linux.

It’s suggested to edit the default key bindings at Writing Unicode characters on Linux, but I can’t figure out how to do this using Preferences→Key Bindings. The “Default” key bindings file is uneditable and I don’t know what to enter to create an override in the “User” key bindings file. The unofficial documentation at http://docs.sublimetext.info/en/latest/reference/key_bindings.html is of no help as to what syntax should be used.

0 Likes

#2

Unless in ST2 the default keybindings are inside a zip folder so you can’t edit it. To disable one keybinding you can create a new keybinding and map it to a unimplemented command (e.g. noop).
If that does not help (as i expect in your scenario) you can use PackageResourceViewer to open the file in Default/Default (Linux).sublime-keymap. This will create a new file, which shadows the file in the zip folder. You can just delete it if you don’t need it anymore: Just open Preferences > Browse Packages… and then navigate into the Default folder and delete it.

0 Likes

#3

Thanks, I got the Linux shortcut working with your advice.

The steps required as I recall them are:

  1. Open to the “Tools” menu and select “Install Package Control” command if it’s not already installed.
  2. Open to the “Tools” menu and select the “Command Palette” (Shift+Ctrl+P) command.
  3. Type “Package Control: Install Package” or scroll to the command of the same name.
  4. Click on the “Package Control: Install Package” command.
  5. Type “PackageResourceViewer” or scroll to the command of the same name.
  6. Click on the “PackageResourceViewer” command.
  7. Open to the “Preferences” menu and select the “Package Settings"→"PackageResourceViewer"→"Settings ‐ User” command.
  8. Per https://packagecontrol.io/packages/PackageResourceViewer, enter the following code:
    { "single_command": false }
  9. Open to the “File” menu and select the “Save” (Ctrl+S) command.
  10. Open to the “Tools” menu and select the “Command Palette” (Shift+Ctrl+P) command.
  11. Type “PackageResourceViewer: Edit Package Resource” or scroll to the command of the same name…
  12. Click on the “PackageResourceViewer: Edit Package Resource” command.
  13. Type “Default” or scroll to the command of the same name.
  14. Click on the “Default” command.
  15. Type “Default (Linux).sublime-keymap” or scroll to the command of the same name.
  16. Click on the “Default (Linux).sublime-keymap” command.
  17. Comment out the line reading “{ "keys": ["ctrl+shift+u"], "command": "soft_redo" },”.
  18. Open to the “File” menu and select the “Save” (Ctrl+S) command.

Also, the “create a new keybinding and map it to a unimplemented command (e.g. noop).” strategy doesn’t work.

1 Like