Sublime Forum

How to change Show Sidebar Keybinding?

#1

I trie doing this:

But that did nothing. I am really confused why it doesn’t work.

I want to show and hide sidebar with Cmd + B hotkey.

0 Likes

#3

It probably does not work, because super+b is already assigned:

	{ "keys": ["super+b"], "command": "build" },

You need to remove it that other assignment to build command.
You can open the Sublime Text Console (Menu view -> Show Console) and run the command:

sublime.log_input(True); sublime.log_commands(True); sublime.log_result_regex(True)

It should show you what does the keybind is doing when you press super+b

0 Likes

#4

How do I remove super+b binding?

I can’t edit the left side code. :disappointed:

0 Likes

#5

You do not need to edit it, just by placing it on your User configuration file, it will override the other automatically. The problem I mentioned is when you define both keybind on the user file.

Can you open the console, enable the Sublime Text logging and post the output here after pressing the keybind super+b?

0 Likes

#6

I get this:

key evt: super+b
command: build
0 Likes

#7

Thanks, now we clearly know that when you define your keybind:

	{ "keys": ["super+b"], "command": "toggle_side_bar" },

it is not overriding the default build command assigned to super+b. Perhaps your keymap file is defining:

{ "keys": ["super+b"], "command": "build" },

somewhere else?

Can you try to revert Sublime Text to a clean state:

  1. https://www.sublimetext.com/docs/3/revert.html

and then try to create your keybind again?

0 Likes

#8

I have few packages and settings I use I don’t want to lose to revert.

Also I don’t define build command anywhere myself. Here is my entire keybindings preferences file:

[
  {
    "keys": ["enter"],
    "command": "double_click_at_caret",
    "context": [
      {
        "key": "selector",
        "operator": "equal",
        "operand": "text.find-in-files",
        "match_all": true
      }
    ]
  },
  { "keys": ["ctrl+d"], "command": "dash_doc" },
  {"keys": ["super+b"], "command": "toggle_side_bar"},
  // TODO: doesn't work
  { "keys": ["ctrl+f"], "command": "gs_doc", "mode": "goto" },

  // TODO: fix cmd + j = console
  // {
  //   "keys": ["super+j"],
  //   "command": "show_panel",
  //   "args": { "panel": "console", "toggle": true }
  // },

  // _vim
  // Unbind `SPC` in `normal-mode`
  // in order to make it a `Prefix` keybinding
  {
    "keys": [" "],
    "command": "noop",
    "context": [{ "key": "six_is_in_command_mode" }]
  },

  // _leader
  // `leader w` to save
  {
    "keys": [" ", "w"],
    "command": "save",
    "context": [{ "key": "six_is_in_command_mode" }]
  }
]

0 Likes

#9

You could backup your files, and revert just to test whether it is working correctly on a clean version.

But you can try now, do edit the default file removing the build keybind. You need to install the package:

  1. https://packagecontrol.io/packages/Extract%20Sublime%20Package

Then you can use it to edit the default file.

0 Likes