Skip to content

Instantly share code, notes, and snippets.

@amiralles
Last active March 30, 2021 03:30
Show Gist options
  • Save amiralles/0a52909d3f93ef1371e96b4cef890dc8 to your computer and use it in GitHub Desktop.
Save amiralles/0a52909d3f93ef1371e96b4cef890dc8 to your computer and use it in GitHub Desktop.
// All of this sortcuts are ergonomic if you remap
// CAPS -> Ctrl
// Right Opt -> Esc
//(I use Karabiner-Elements for that.)
[
{ "keys": [",", "/"],
"context": [
{ "key": "setting.command_mode", "operand": true },
{ "key": "setting.is_widget", "operand": false }
],
"command": "run_macro_file",
"args": {
"file": "Packages/User/comment-and-move-to-the-next-line.sublime-macro"}
},
{ "command": "toggle_show_open_files","keys": ["super+shift+o"] },
{ "keys": ["super+q"], "command": "" },
{ "keys": ["f2"], "command": "context_menu" },
{ "keys": ["super+shift+r"], "command": "reindent" },
{ "keys": ["super+b"], "command": "goto_definition" },
{ "keys": ["ctrl+enter"], "command": "exit_insert_mode" },
{
"keys": ["shift+enter"],
"command": "exit_insert_mode",
"context": [
{ "key": "setting.command_mode", "operand": false },
{ "key": "setting.is_widget", "operand": false }
]
},
// <leader> t
{ "keys": [",", "t"],
"context": [
{ "key": "setting.command_mode", "operand": true },
{ "key": "setting.is_widget", "operand": false }
],
"command": "show_overlay",
"args": {"overlay": "goto", "show_files": true}
},
// <leader><leader>
// jump back/forth last used tabs.
{ "keys": [",", ","],
"context": [
{ "key": "setting.command_mode", "operand": true },
{ "key": "setting.is_widget", "operand": false }
],
"command": "next_view_in_stack"
},
// <leader> 1
// Back to standard layout
{ "keys": [",", "1"],
"context": [
{ "key": "setting.command_mode", "operand": true },
{ "key": "setting.is_widget", "operand": false }
],
"command": "set_layout",
"args" : {
"cells": [[0, 0, 1, 1]],
"cols": [0.0, 1.0],
"rows": [0.0, 1.0]
}
},
// <leader> 2
// split panes vertically
{ "keys": [",", "2"],
"context": [
{ "key": "setting.command_mode", "operand": true },
{ "key": "setting.is_widget", "operand": false }
],
"command": "set_layout",
"args" : {
"cells": [[0, 0, 1, 1], [1, 0, 2, 1]],
"cols": [0.0, 0.5, 1.0],
"rows": [0.0, 1.0]
}
},
// <leader> 3
// split panes horizontally
{ "keys": [",", "3"],
"context": [
{ "key": "setting.command_mode", "operand": true },
{ "key": "setting.is_widget", "operand": false }
],
"command": "set_layout",
"args" : {
"cells": [[0, 0, 1, 1], [0, 1, 1, 2]],
"cols": [0.0, 1.0],
"rows": [0.0, 0.5, 1.0]
}
},
// Focus on pane 1
{ "keys": ["ctrl+1"],
"context": [
{ "key": "setting.command_mode", "operand": true },
{ "key": "setting.is_widget", "operand": false }
],
"command": "focus_group",
"args" : {
"group": 0
}
},
// Focus on pane 2
{ "keys": ["ctrl+2"],
"context": [
{ "key": "setting.command_mode", "operand": true },
{ "key": "setting.is_widget", "operand": false }
],
"command": "focus_group",
"args" : {
"group": 1
}
},
// Non acrobatic way to launch "goto line"
{
"keys": ["ctrl+l"], "command": "show_overlay",
"args": {"overlay": "goto", "text": ":"}
},
{
"keys": ["ctrl+w"], "command": "delete_word",
"args": {"forward": false, "sub_words": true}
},
// Emulate vi word/line motions. (sort of)
{
"keys": ["ctrl+b"], "command": "move",
"args": { "by": "words", "forward": false }
},
{
"keys": ["ctrl+j"], "command": "move",
"args": { "by": "lines", "forward": true }
},
{
"keys": ["ctrl+k"], "command": "move",
"args": { "by": "lines", "forward": false }
},
{
"keys": ["ctrl+g"], "command": "move_to",
"args": { "to": "bof" }
},
{
"keys": ["ctrl+shift+g"], "command": "move_to",
"args": { "to": "eof" }
},
{
"keys": ["ctrl+4"], "command": "move_to",
"args": { "to": "eol" }
},
{
"keys": ["ctrl+6"], "command": "move_to",
"args": { "to": "bol" }
},
// Trigger search.
{
"keys": ["ctrl+/"], "command": "show_panel",
"args": {"panel": "find", "reverse": false }
},
{
"keys": ["ctrl+shift+/"], "command": "show_panel",
"args": {"panel": "find", "reverse": true }
},
// Jump by paragraph
{ "keys": ["ctrl+["], "command": "move", "args": { "by": "stops", "empty_line": true, "forward": false }},
{ "keys": ["ctrl+]"], "command": "move", "args": { "by": "stops", "empty_line": true, "forward": true }},
// Select by paragraph
{ "keys": ["shift+ctrl+["], "command": "move", "args": { "by": "stops", "empty_line": true, "forward": false, "extend": true }},
{ "keys": ["shift+ctrl+]"], "command": "move", "args": { "by": "stops", "empty_line": true, "forward": true, "extend": true }},
{ "keys": ["f7"], "command": "" },
{ "keys": ["super+shift+b"], "command": "" },
{ "keys": ["super+o"], "command": "" },
// Tab Switcher (Requires the Extended Tab Switcher plugin)
{ "keys": [",","m"],
"context": [
{ "key": "setting.command_mode", "operand": true },
{ "key": "setting.is_widget", "operand": false }
],
"command": "extended_switcher",
"args": {"list_mode": "window"}
},
// Toggle "Favorites Files" (Requires the Sublime-Favorites plugin)
{ "keys": [",","."],
"context": [
{ "key": "setting.command_mode", "operand": true },
{ "key": "setting.is_widget", "operand": false }
],
"command": "show_favorites"
},
// Misc
{ "keys": ["ctrl+s"], "command": "save"},
{ "keys": ["super+escape"], "command": "save_all"},
{ "keys": ["f5"], "command": "sort_lines" },
{ "keys": ["ctrl+f5"], "command": "sort_lines"},
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment