I need to install two Sublime Text plugin but their shortcut keys are conflicted.

How can I fix this?

  • You need to remap one of the shortcuts to something else. Do the plugins have menu entries in Preferences » Package Settings » Plugin » Key Bindings – User? For clarity: What plugins are you talking about? – slhck Jan 6 '13 at 15:13
  • No they don't have Key Bindings menu entries. I use these plugins : CSS Color Converter and Color Picker. both of them using cmd+shift+c – webchun Jan 6 '13 at 15:19

Open Sublime and go to Preferences » Browse Packages….

Here, look for one of the conflicting packages—the one you want to change the shortcut for—and open the file Default (OSX).sublime-keymap (or any of the other files for other operating systems).

The file will contain the list of keyboard shortcuts the package accepts, e.g. here for the Alignment package.

    { "keys": ["super+ctrl+a"], "command": "alignment" }

Identify the command you want to change the shortcut for.

Now head to Preferences » Key Bindings – User, and override this shortcut, by copying the default shortcut, and simply changing the keys, for example:

    { "keys": ["super+ctrl+x"], "command": "alignment" }

Just make sure that the command is the same. Now save, and your user preferences will override the package's defaults. So whenever you press your user-defined shortcut, the right command is sent to the package.

You could, in theory, overwrite the default file in the package folder, which would be faster but harder to track down. Also, if the package ever updated, you'd lose your custom shortcut.

  • Thanks alot. I've decided to overwrite the keymap file :) – webchun Jan 6 '13 at 15:56

Also to supplement the above answer, the two packages you use https://github.com/TheDutchCoder/ColorConvert and https://github.com/weslly/ColorPicker have keymap files, so you could edit these, but the above method would be better as it would survive any updates to those packages.

  • Yup. I had just made an edit explaining that caveat :) – slhck Jan 6 '13 at 15:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.