Skip to content

Instantly share code, notes, and snippets.

@daniel-nelson
Created March 22, 2012 22:09
Show Gist options
  • Save daniel-nelson/2164995 to your computer and use it in GitHub Desktop.
Save daniel-nelson/2164995 to your computer and use it in GitHub Desktop.
my Sublime Text 2 keybindings (requires Vintage package)
[
{ "keys": ["ctrl+space"], "command": "exit_insert_mode",
"context":
[
{ "key": "setting.command_mode", "operand": false },
{ "key": "setting.is_widget", "operand": false }
]
},
{ "keys": ["s"], "command": "save", "context": [{"key": "setting.command_mode"}] },
{ "keys": ["U"], "command": "redo", "context": [{"key": "setting.command_mode"}] },
{ "keys": [","], "command": "prev_group", "context": [{"key": "setting.command_mode"}] },
{ "keys": ["."], "command": "prev_group", "context": [{"key": "setting.command_mode"}] },
{ "keys": ["]"], "command": "forward_paragraph", "context": [{"key": "setting.command_mode"}] },
{ "keys": ["["], "command": "backward_paragraph", "context": [{"key": "setting.command_mode"}] },
{ "keys": ["m"], "command": "show_at_center", "context": [{"key": "setting.command_mode"}] },
{ "keys": ["ctrl+shift+m"], "command": "expand_selection", "args": {"to": "brackets"} },
{ "keys": ["B"], "command": "move_to", "args": {"to": "brackets"}, "context": [{"key": "setting.command_mode"}] },
{ "keys": [" "], "command": "set_mark", "context": [{"key": "setting.command_mode"}] },
{ "keys": ["shift+space"], "command": "clear_bookmarks", "args": {"name": "mark"}, "context": [{"key": "setting.command_mode"}] },
{ "keys": ["n"], "command": "select_to_mark", "context": [{"key": "setting.command_mode"}] },
{ "keys": ["q"], "command": "toggle_comment", "args": { "block": false }, "context": [{"key": "setting.command_mode"}] },
// find forward and backward
{ "keys": ["ctrl+s"], "command": "find_next" },
{ "keys": ["ctrl+r"], "command": "find_prev" },
{ "keys": ["ctrl+s"], "command": "show_panel", "args": {"panel": "incremental_find", "reverse":false}, "context": [{"key": "setting.command_mode"}] },
// find and replace
{ "keys": ["R"], "command": "show_panel", "args": {"panel": "replace"}, "context": [{"key": "setting.command_mode"}] },
// find in files
{ "keys": ["E"], "command": "show_panel", "args": {"panel": "find_in_files"}, "context": [{"key": "setting.command_mode"}] },
// fuzzy file open
{ "keys": ["f"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true}, "context": [{"key": "setting.command_mode"}] },
// cycle through open buffers
{ "keys": ["{"], "command": "prev_view", "context": [{"key": "setting.command_mode"}] },
{ "keys": ["}"], "command": "next_view", "context": [{"key": "setting.command_mode"}] },
// { "keys": ["}"], "command": "prev_view_in_stack", "context": [{"key": "setting.command_mode"}] },
// { "keys": ["{"], "command": "next_view_in_stack", "context": [{"key": "setting.command_mode"}] },
// fuzzy goto method in file
{ "keys": ["z"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"}, "context": [{"key": "setting.command_mode"}] },
// equivalent to emacs M-x
{ "keys": ["C"], "command": "show_overlay", "args": {"overlay": "command_palette"}, "context": [{"key": "setting.command_mode"}] },
{ "keys": ["g"], "command": "goto_line", "args": {"line": 1}, "context": [{"key": "setting.command_mode"}] },
{ "keys": ["G"], "command": "goto_line", "args": {"line": 0}, "context": [{"key": "setting.command_mode"}] },
{ "keys": ["ctrl+o"], "command": "insert", "args": {"characters": "\n"} },
// move by words
{ "keys": ["w"], "command": "set_motion", "args": {
"motion": "move",
"motion_args": {"by": "stops", "word_begin": true, "sub_word_begin": false, "punct_begin": true, "empty_line": true, "forward": true, "extend": true },
"clip_to_line": true },
"context": [{"key": "setting.command_mode"}]
},
{ "keys": ["w"], "command": "set_motion", "args": {
"motion": "move",
"motion_args": {"by": "stops", "word_end": true, "sub_word_end": false, "punct_end": false, "empty_line": true, "forward": true, "extend": true },
"inclusive": true,
"clip_to_line": true },
"context":
[
{"key": "setting.command_mode"},
{"key": "vi_action", "operand": "enter_insert_mode"}
]
},
{ "keys": ["b"], "command": "set_motion", "args": {
"motion": "move",
"motion_args": {"by": "stops", "word_begin": true, "sub_word_begin": false, "punct_begin": false, "empty_line": true, "forward": false, "extend": true },
"clip_to_line": true },
"context": [{"key": "setting.command_mode"}]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment