Skip to content

Sublime Text

Reference

  • Command (or Cmd)
    • super for Sublime
  • Shift
    • shift for Sublime
  • Option (or Alt)
    • alt for Sublime
  • Control (or Ctrl)
    • ctrl for Sublime

Shortcuts

  • Go to File -> ⌘p
  • Open Command Palette -> ⇧⌘p
  • Go Back (in definition trail) -> ⌃-
  • Go Forward (in definition trail) -> ⇧⌃-
  • Force show code suggestions -> ⌃space
  • Fold code block -> ⌥⌘[
  • Unfold code block -> ⌥⌘]
  • Toggle Case Sensitvity in Find & Replace -> ⌥⌘c
  • Show symbols in current file -> ⌘r

Custom Shortcuts

To set key bindings, navigate to Sublime TextSettingsKey Bindings on macOS. Alternatively, you can search for "Key Bindings" in Command Palette as well.

Key Bindings in Sublime Text are set using a JSON configuration and inside this file, the special keys are mapped as follows:

Overall Key Bindings Config

json
[
  { "keys": ["super+b"], "command": "goto_definition" },
  { "keys": ["alt+1"], "command": "toggle_side_bar" },
  { "keys": ["ctrl+r"], "command": "prompt_select_workspace" },
  {
    "keys": ["ctrl+`"],
    "command": "toggle_terminus_panel",
    "args" : {
      "cmd": "bash",
      "cwd": "${file_path:${folder}}",
      "panel_name": "Terminus"
    }
  },
  { 
    "keys": ["super+enter"],
    "command": "replace_all",
    "args": {"close_panel": true},
    "context": [
      {"key": "panel", "operand": "replace"},
      {"key": "panel_has_focus"}
    ]
  },
  { 
    "keys": ["super+alt+enter"],
    "command": "replace_all",
    "context": [
      {"key": "panel", "operand": "find_in_files"},
      {"key": "panel_has_focus"}
    ]
  }
]

Go to Definition

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

Toggle Side Bar Visibility

json
{ "keys": ["alt+1"], "command": "toggle_side_bar" }

Prompt Select Workspace

json
{ "keys": ["ctrl+r"], "command": "prompt_select_workspace" }

Toggle Terminal

This requires the extension Terminus to be installed.

json
{
  "keys": ["ctrl+`"],
  "command": "toggle_terminus_panel",
  "args" : {
    "cmd": "bash",
    "cwd": "${file_path:${folder}}",
    "panel_name": "Terminus"
  }
}

Replace All

json
{ 
  "keys": ["super+enter"],
  "command": "replace_all",
  "args": {"close_panel": true},
  "context": [
    {"key": "panel", "operand": "replace"},
    {"key": "panel_has_focus"}
  ]
}

To perform same operation for "Find in Files", use:

json
{ 
  "keys": ["super+alt+enter"],
  "command": "replace_all",
  "context": [
    {"key": "panel", "operand": "find_in_files"},
    {"key": "panel_has_focus"}
  ]
}