Skip to content

Instantly share code, notes, and snippets.

@ivan-krukov
Created October 3, 2016 22:44
Show Gist options
  • Save ivan-krukov/ffa02c0659d8abefa805b1164f2024ad to your computer and use it in GitHub Desktop.
Save ivan-krukov/ffa02c0659d8abefa805b1164f2024ad to your computer and use it in GitHub Desktop.
Keybindings
[
// Align
{ "keys": ["super+.", "super+a"], "command": "alignment" },
// Surround
{ "keys": ["super+.", "super+s", "super+s"], "command": "surround_selection"},
{ "keys": ["super+.", "super+s", "super+d"], "command": "surround_delete"},
{ "keys": ["super+.", "super+s", "super+c"], "command": "surround_change"},
// Expand selection
{ "keys": ["super+shift+'"], "command": "expand_selection_to_quotes"},
{ "keys": ["super+shift+;"], "command": "expand_selection", "args": {"to": "scope"}},
// Emacs
{"keys": ["alt+x"], "command": "show_overlay", "args":{"overlay": "command_palette"}},
{"keys": ["super+="], "command": "reindent"},
// {"keys": ["ctrl+/"], "command": "undo"},
// // Movement
// {"keys": ["alt+f"], "command": "move", "args":{"by": "subword_ends", "forward": true}},
// {"keys": ["alt+shift+f"], "command": "move", "args":{"by": "subword_ends", "forward": true, "extend": true}},
// {"keys": ["alt+b"], "command": "move", "args":{"by": "subwords", "forward": false}},
// {"keys": ["alt+shift+b"], "command": "move", "args":{"by": "subwords", "forward": false, "extend": true}},
// {"keys": ["ctrl+p"], "command": "move", "args":{"by": "lines", "forward": false}},
// {"keys": ["ctrl+shift+p"], "command": "move", "args":{"by": "lines", "forward": false, "extend": true}},
// {"keys": ["ctrl+n"], "command": "move", "args":{"by": "lines", "forward": true}},
// {"keys": ["ctrl+shift+n"], "command": "move", "args":{"by": "lines", "forward": true, "extend": true}},
// {"keys": ["ctrl+l"], "command": "show_at_center"},
// // No arrows!
{"keys": ["left"], "command": "noop"},
{"keys": ["right"], "command": "noop"},
{"keys": ["up"], "command": "noop"},
{"keys": ["down"], "command": "noop"},
// {"keys": ["alt+,"], "command": "move_to", "args": {"to": "bof"}},
// {"keys": ["alt+shift+,"], "command": "move_to", "args": {"to": "bof", "extend": true}},
// {"keys": ["alt+."], "command": "move_to", "args": {"to": "eof"}},
// {"keys": ["alt+shift+."], "command": "move_to", "args": {"to": "eof", "extend": true}},
// {"keys": ["ctrl+a"], "command": "move_to", "args": {"to": "bol"}},
// {"keys": ["ctrl+shift+a"], "command": "move_to", "args": {"to": "bol", "extend": true}},
// {"keys": ["ctrl+e"], "command": "move_to", "args": {"to": "eol"}},
// {"keys": ["ctrl+shift+e"], "command": "move_to", "args": {"to": "eol", "extend": true}},
{"keys": ["ctrl+s"], "command": "show_panel", "args": {"panel": "find"}},
{"keys": ["ctrl+r"], "command": "show_panel", "args": {"panel": "replace"}},
{"keys": ["ctrl+space"], "command": "set_mark"},
{"keys": ["ctrl+y"], "command": "paste"},
{"keys": ["ctrl+x", "ctrl+m"], "command": "select_to_mark"},
{"keys": ["ctrl+x", "ctrl+s"], "command": "save"},
{"keys": ["ctrl+x", "ctrl+w"], "command": "prompt_save_as"},
{"keys": ["ctrl+x", "ctrl+c"], "command": "close"},
{"keys": ["ctrl+x", "ctrl+f"], "command": "prompt_open"},
{"keys": ["ctrl+x", "h"], "command": "select_all"}
]
/* ~/Library/KeyBindings/DefaultKeyBinding.dict */
/* Emacs bindings everywhere */
{
/* Additional Emacs bindings */
"^n" = moveDown:;
"^p" = moveUp:;
"^f" = moveRight:;
"^b" = moveLeft:;
"^v" = scrollPageDown:;
"~v" = scrollPageUp:;
"~m" = moveToLeftEndOfLine:;
"~M" = moveToLeftEndOfLineAndModifySelection:;
"^a" = moveToBeginningOfLine:;
"^A" = moveToBeginningOfLineAndModifySelection:;
"^e" = moveToEndOfLine:;
"^E" = moveToEndOfLineAndModifySelection:;
"^K" = (moveToBeginningOfLine:, deleteToEndOfLine:, deleteToEndOfLine);
"^ " = setMark:;
"^/" = undo:;
"^w" = cut:;
"^w" = cut:;
"~w" = copy:;
"^y" = paste:;
"^V" = pageDownAndModifySelection:;
"~d" = deleteWordForward:;
"~b" = moveWordBackward:;
"~h" = deleteWordBackward:;
"~f" = moveWordForward:;
"~B" = moveWordBackwardAndModifySelection:;
"~F" = moveWordForwardAndModifySelection:;
"~<" = moveToBeginningOfDocument:;
"~>" = moveToEndOfDocument:;
"^x" = {
"^c" = performClose:;
"^f" = openDocument:;
"^m" = selectToMark:;
"^s" = saveDocument:;
"^w" = saveDocumentAs:;
"h" = selectAll:;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment