Skip to content

Instantly share code, notes, and snippets.

@monnoval
Created July 25, 2014 10:20
Show Gist options
  • Save monnoval/f3395be42e18dc72aef2 to your computer and use it in GitHub Desktop.
Save monnoval/f3395be42e18dc72aef2 to your computer and use it in GitHub Desktop.
Sublime Text Custom Keybindings
[
// BASIC COMMANDS
//
// `;;` to acts same as escape key
{ "keys": [";", ";"], "command": "exit_insert_mode",
"context":
[
{ "key": "setting.command_mode", "operand": false },
{ "key": "setting.is_widget", "operand": false }
]
},
{ "keys": [";", ";"], "command": "exit_insert_mode",
"context":
[
{ "key": "setting.command_mode", "operand": false },
{ "key": "setting.is_widget", "operand": false }
]
},
{ "keys": [";", ";"], "command": "exit_visual_mode",
"context":
[
{ "key": "setting.command_mode"},
{ "key": "num_selections", "operand": 1},
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": false }
]
},
{ "keys": [";", ";"], "command": "hide_auto_complete", "context":
[
{ "key": "auto_complete_visible", "operator": "equal", "operand": true }
]
},
{ "keys": [";", ";"], "command": "vi_cancel_current_action", "context":
[
{ "key": "setting.command_mode" },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false },
{ "key": "vi_has_input_state" }
]
},
// `,a` Save all
{ "keys": [",", "a"], "command": "save_all" },
// `,w` Save current file
{ "keys": [",", "w"], "command": "save" },
// `,q` `,x` Close current file
{ "keys": [",", "x"], "command": "close" },
{ "keys": [",", "q"], "command": "close" },
// WINDOW MOVEMENTS
//
// `Control Shift -` Close HTML Tag
{ "keys": ["ctrl+shift+-"], "command": "close_tag" },
// `Control H` Move to left pane
{ "keys": ["ctrl+h"], "command": "focus_group", "args": { "group": 0 } },
// `Control L` Move to right pane
{ "keys": ["ctrl+l"], "command": "focus_group", "args": { "group": 1 } },
// `Control L` Toggle full screen
{ "keys": ["ctrl+enter"], "command": "toggle_distraction_free" },
// WINDOW SPLITS
//
// `,v` Single pane
{
"keys": [",", "v"],
"command": "set_layout",
"args":
{
"cols": [0.0, 1.0],
"rows": [0.0, 1.0],
"cells": [[0, 0, 1, 1]]
}
},
// `,vv` Split into two vertical panes
{
"keys": [",", "v", "v"],
"command": "set_layout",
"args":
{
"cols": [0.0, 0.5, 1.0],
"rows": [0.0, 1.0],
"cells": [[0, 0, 1, 1], [1, 0, 2, 1]]
}
},
// `,s` Single pane
{
"keys": [",", "s"],
"command": "set_layout",
"args":
{
"cols": [0.0, 1.0],
"rows": [0.0, 1.0],
"cells": [[0, 0, 1, 1]]
}
},
// `,ss` Split into two horizontal panes
{
"keys": [",", "s", "s"],
"command": "set_layout",
"args":
{
"cols": [0.0, 1.0],
"rows": [0.0, 0.5, 1.0],
"cells": [[0, 0, 1, 1], [0, 1, 1, 2]]
}
},
// `,sss` Split into three horizontal panes
{
"keys": [",", "s", "s", "s"],
"command": "set_layout",
"args":
{
"cols": [0.0, 1.0],
"rows": [0.0, 0.33, 0.66, 1.0],
"cells": [[0, 0, 1, 1], [0, 1, 1, 2], [0, 2, 1, 3]]
}
},
// FILE / FOLDER CREATION
//
// ',n' to create new file or folder
{ "keys": [",", "n"], "command": "advanced_new_file",
"context":
[
{ "key": "setting.command_mode", "operand": true}
]
},
// SEARCH
//
// ',g' Go to file
{
"keys": [",", "g"],
"command": "show_overlay",
"args":
{
"overlay": "goto", "show_files": true
}
},
// ',r' Goto symbol
{
"keys": [",", "r"],
"command": "show_overlay",
"args": {"overlay": "goto", "text": "@"}
},
// ',f' Find in files inside the project
{
"keys": [",", "f"],
"command": "show_panel",
"args": {"panel": "find_in_files"}
},
// 'gf' Go to result (only used in search results)
{ "keys": ["g", "f"], "command": "prev_result" },
// 'Control a' Increase number up
// { "keys": ["ctrl+a"], "command": "scroll_lines", "args": {"amount": 1.0 } },
{
"keys": ["ctrl+a"],
"command": "inc_dec_value",
"args": { "action": "inc_min" }
},
// 'Control x' Decrease number down
// { "keys": ["ctrl+x"], "command": "scroll_lines", "args": {"amount": -1.0 } },
{
"keys": ["ctrl+x"],
"command": "inc_dec_value",
"args": { "action": "dec_min" }
},
// Jump from prev and next location
{ "keys": ["ctrl+o"], "command": "jump_to_change", "args": {"move": -1}, "context": [{"key": "setting.command_mode"}]},
{ "keys": ["ctrl+i"], "command": "jump_to_change", "args": {"move": 1}, "context": [{"key": "setting.command_mode"}]},
// SingleLine is a CSS Single to Multiline Style Switch plugin for Sublime Text 2.
{ "keys": [",", "t"], "command": "toggle_single_line_css"},
// HTML Tidy
// { "keys": [",", ","], "command": "html_tidy" },
// FOLDING
//
// 'zc' Close fold
{ "keys": ["z", "c"], "command": "fold" },
// 'zo' Open fold
{ "keys": ["z", "o"], "command": "unfold" },
// 'zr' Open all folds
{ "keys": ["z", "r"], "command": "unfold_all" },
// 'zR' Open all folds
{ "keys": ["z", "R"], "command": "unfold_all" }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment