Skip to content

Instantly share code, notes, and snippets.

@amiralles
Last active October 17, 2024 18:07
Show Gist options
  • Save amiralles/c05b88c381cdd0ee20a8d74043fb0a06 to your computer and use it in GitHub Desktop.
Save amiralles/c05b88c381cdd0ee20a8d74043fb0a06 to your computer and use it in GitHub Desktop.
// These shortcuts go easy on your wrists if you remap CAPS -> Ctrl.
[
{ "keys": [",", "/"],
"context": [
{ "key": "setting.command_mode", "operand": true },
{ "key": "setting.is_widget", "operand": false }
],
"command": "toggle_comment",
"args": { "block": false }
},
// Jump to file from search results.
{ "keys": ["g", "f"],
"context": [
{ "key": "setting.command_mode", "operand": true },
{ "key": "setting.is_widget", "operand": false }
],
"command": "prev_result"
},
{
"keys": ["j", "j"],
"command": "exit_insert_mode",
"context":
[
{ "key": "setting.command_mode", "operand": false },
{ "key": "setting.is_widget", "operand": false }
]
},
{
"keys": ["i", "i"],
"command": "insert_inspect",
"context":
[
{ "key": "setting.command_mode", "operand": false },
{ "key": "setting.is_widget", "operand": false }
]
},
{ "command": "toggle_show_open_files","keys": ["super+shift+o"] },
{ "keys": ["super+q"], "command": "" },
{ "keys": ["super+j"], "command": "join_lines" },
{ "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 }
]
},
// Overrides Sublime's default "vintage prompt."
// (Requires -> https://github.com/amiralles/run-vim-commands)
{ "keys": [":"],
"context": [
{ "key": "setting.command_mode", "operand": true },
{ "key": "setting.is_widget", "operand": false }
],
"command": "vintage_ex_prompt",
},
// <leader> t
{ "keys": [",", "t"],
"context": [
{ "key": "setting.command_mode", "operand": true },
{ "key": "setting.is_widget", "operand": false }
],
"command": "jump_to_ex_test_file"
},
// <leader><leader>
// jumps back/forth last used tabs.
{ "keys": [",", ","],
"context": [
{ "key": "setting.command_mode", "operand": true },
{ "key": "setting.is_widget", "operand": false }
],
"command": "next_view_in_stack"
},
// jumps back/forth between the previous and next cursor positions.
{ "keys": ["`", "`"],
"context": [
{ "key": "setting.command_mode", "operand": true },
{ "key": "setting.is_widget", "operand": false }
],
"command": "backticks_jump"
},
// <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}
},
// Trigger search.
{
"keys": ["ctrl+/"], "command": "show_panel",
"args": {"panel": "find", "reverse": false }
},
{
"keys": ["ctrl+shift+/"], "command": "show_panel",
"args": {"panel": "find", "reverse": true }
},
{ "keys": ["tab"], "command": "auto_complete", "args": {"default": "\t", "exact": false},
"context":
[
{ "key": "setting.tab_completion", "operator": "equal", "operand": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": ".*[^0-9][^\r ^\n ^\t ^\f]", "match_all": false },
]
},
{ "keys": ["tab"], "command": "auto_complete", "args": {"default": "\t", "exact": false},
"context":
[
{ "key": "setting.tab_completion", "operator": "equal", "operand": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": "[][a-z]", "match_all": false },
]
},
// 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": "" },
{ "keys": [",","m"],
"context": [
{ "key": "setting.command_mode", "operand": true },
{ "key": "setting.is_widget", "operand": false }
],
"command": "mru"
},
// Toggle Bookmark
{ "keys": ["m","m"],
"context": [
{ "key": "setting.command_mode", "operand": true },
{ "key": "setting.is_widget", "operand": false }
],
"command": "bookmark"
},
// 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