Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save irrationalistic/9623fe3757192d526f31 to your computer and use it in GitHub Desktop.
Save irrationalistic/9623fe3757192d526f31 to your computer and use it in GitHub Desktop.
Vim Colemak keybindings in ST3 (windows)
[
// movement in command mode
// up
{
"keys": ["e"],
"command": "set_motion",
"args": {
"motion": "move",
"motion_args": {"by": "lines", "extend": true, "forward": false }
},
"context": [{ "key": "setting.command_mode" }]
},
// down
{
"keys": ["n"],
"command": "set_motion",
"args": {
"motion": "move",
"motion_args": {"by": "lines", "extend": true, "forward": true }
},
"context": [{ "key": "setting.command_mode" }]
},
// right
{ "keys": ["i"], "command": "set_motion", "args": {
"motion": "vi_move_by_characters_in_line",
"motion_args": {"forward": true, "extend": true, "visual": false }},
"context": [{"key": "setting.command_mode"}]
},
// left
{ "keys": ["h"], "command": "set_motion", "args": {
"motion": "vi_move_by_characters_in_line",
"motion_args": {"forward": false, "extend": true }},
"context": [{"key": "setting.command_mode"}]
},
// End-word jumps
// Bumped from 'e'
{ "keys": ["j"], "command": "set_motion", "args": {
"motion": "move",
"motion_args": {"by": "stops", "word_end": true, "punct_end": true, "empty_line": true, "forward": true, "extend": true },
"inclusive": true,
"clip_to_line": true },
"context": [{"key": "setting.command_mode"}]
},
{ "keys": ["J"], "command": "set_motion", "args": {
"motion": "move",
"motion_args": {"by": "stops", "word_end": true, "empty_line": true, "separators": "", "forward": true, "extend": true },
"inclusive": true,
"clip_to_line": true },
"context": [{"key": "setting.command_mode"}]
},
// page movement in command mode
// up
{
"keys": ["ctrl+e"],
"command": "vi_scroll_lines",
"args": { "forward": false},
"context": [{ "key": "setting.command_mode" }]
},
// down
{
"keys": ["ctrl+n"],
"command": "vi_scroll_lines",
"context": [{ "key": "setting.command_mode" }]
},
// move by 5 lines at a time in command mode
// Plugin dependency: Preferences/User/Move_caret_forwardCommand.py
// move up or down by 5 lines in insert mode
{
"keys": ["ctrl+shift+e"],
"command": "move_multi",
"args": { "by": "lines", "amount": -5 },
"context": [{ "key": "setting.command_mode", "operand": false }]
},
{
"keys": ["ctrl+shift+n"],
"command": "move_multi",
"args": { "by": "lines", "amount": 5 },
"context": [{ "key": "setting.command_mode", "operand": false }]
},
// insert (bumped from 'i')
{
"keys": ["k"],
"command": "enter_insert_mode",
"context": [{ "key": "setting.command_mode" }]
},
// escape insert mode
{
"keys": ["ctrl+k"],
"command": "exit_insert_mode",
"context": [{ "key": "setting.command_mode", "operand": false }]
},
// basic movement without leaving insert mode
{
"keys": ["ctrl+e"],
"command": "move",
"args": { "by": "lines", "forward": false },
"context": [{ "key": "setting.command_mode", "operand": false }]
},
{
"keys": ["ctrl+n"],
"command": "move",
"args": { "by": "lines", "forward": true },
"context": [{ "key": "setting.command_mode", "operand": false }]
},
{
"keys": ["ctrl+h"],
"command": "move",
"args": { "by": "characters", "forward": false },
"context": [{ "key": "setting.command_mode", "operand": false }]
},
{
"keys": ["ctrl+i"],
"command": "move",
"args": { "by": "characters", "forward": true },
"context": [{ "key": "setting.command_mode", "operand": false }]
},
// move by words in insert mode
{
"keys": ["ctrl+shift+h"],
"command": "move",
"args": { "by": "words", "forward": false }
},
{
"keys": ["ctrl+shift+i"],
"command": "move",
"args": { "by": "words", "forward": true }
},
// move to beginning of line (INSERT MODE)
{
"keys": ["ctrl+0"],
"command": "move_to",
"args": { "to": "bol" },
"context": [{ "key": "setting.command_mode", "operand": false }]
},
// move to end of line in (INSERT MODE)
{
"keys": ["ctrl+shift+0"],
"command": "move_to",
"args": { "to": "eol" },
"context": [{ "key": "setting.command_mode", "operand": false }]
},
// 0 to bol instead of hardbol
{ "keys": ["0"], "command": "set_motion", "args": {
"motion": "move_to",
"motion_args": {"to": "bol", "extend": true }},
"context":
[
{"key": "setting.command_mode"},
{"key": "vi_has_repeat_digit", "operand": false}
]
},
// shift+0 mimics $ (COMMAND MODE)
{
"keys": [")"],
"command": "move_to",
"args": { "to": "eol" },
"context": [{ "key": "setting.command_mode" }]
},
// new tab
{ "keys": ["ctrl+t"], "command": "new_file" },
// show files overlay, bumped from ctrl+t
{ "keys": ["ctrl+/"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
// open user key bindings
{
"keys": ["ctrl+shift+,"],
"command": "open_file",
"args": { "file": "${packages}/User/Default (Windows).sublime-keymap"
}
},
{ "keys": ["ctrl+shift+r"], "command": "quick_file_move" },
{ "keys": ["ctrl+alt+a"], "command": "alignment" },
{
"keys": ["ctrl+shift+;"],
"command": "single_selection",
"context": [{ "key": "setting.command_mode" }]
},
{ "keys": ["ctrl+;"], "command": "split_selection_into_lines" },
{ "keys": ["s"], "command": "enter_insert_mode",
"context":
[
{"key": "setting.command_mode"},
{"key": "selection_empty"}
]
},
{ "keys": ["S"], "command": "enter_insert_mode", "args":
{"insert_command": "vi_move_to_first_non_white_space_character"},
"context": [{"key": "setting.command_mode"}]
},
{ "keys": ["S"], "command": "enter_insert_mode",
"args": {"insert_command": "shrink_selections_to_beginning"},
"context": [
{"key": "setting.command_mode"},
{"key": "selection_empty", "operator": "equal", "operand": false}
]
},
// Text Object motions
{ "keys": ["i", "w"], "command": "set_motion", "args": {
"motion": "vi_expand_to_words",
"motion_args": {"repeat": 1}},
"context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
},
{ "keys": ["i", "W"], "command": "set_motion", "args": {
"motion": "vi_expand_to_big_words",
"motion_args": {"repeat": 1}},
"context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
},
{ "keys": ["i", "\""], "command": "set_motion", "args": {
"motion": "vi_expand_to_quotes",
"motion_args": {"character": "\""}},
"context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
},
{ "keys": ["i", "'"], "command": "set_motion", "args": {
"motion": "vi_expand_to_quotes",
"motion_args": {"character": "'"}},
"context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
},
{ "keys": ["i", "t"], "command": "set_motion", "args": {
"motion": "vi_expand_to_tag"},
"context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
},
{ "keys": ["i", "("], "command": "set_motion", "args": {
"motion": "vi_expand_to_brackets",
"motion_args": {"character": "("}},
"context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
},
{ "keys": ["i", ")"], "command": "set_motion", "args": {
"motion": "vi_expand_to_brackets",
"motion_args": {"character": "("}},
"context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
},
{ "keys": ["i", "b"], "command": "set_motion", "args": {
"motion": "vi_expand_to_brackets",
"motion_args": {"character": "("}},
"context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
},
{ "keys": ["i", "["], "command": "set_motion", "args": {
"motion": "vi_expand_to_brackets",
"motion_args": {"character": "["}},
"context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
},
{ "keys": ["i", "]"], "command": "set_motion", "args": {
"motion": "vi_expand_to_brackets",
"motion_args": {"character": "["}},
"context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
},
{ "keys": ["i", "{"], "command": "set_motion", "args": {
"motion": "vi_expand_to_brackets",
"motion_args": {"character": "{"}},
"context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
},
{ "keys": ["i", "}"], "command": "set_motion", "args": {
"motion": "vi_expand_to_brackets",
"motion_args": {"character": "{"}},
"context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
},
{ "keys": ["i", "B"], "command": "set_motion", "args": {
"motion": "vi_expand_to_brackets",
"motion_args": {"character": "{"}},
"context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
},
{ "keys": ["i", ">"], "command": "set_motion", "args": {
"motion": "vi_expand_to_brackets",
"motion_args": {"character": "<"}},
"context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
},
{ "keys": ["i", "<"], "command": "set_motion", "args": {
"motion": "vi_expand_to_brackets",
"motion_args": {"character": ">"}},
"context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
},
{ "keys": ["a", ">"], "command": "set_motion", "args": {
"motion": "vi_expand_to_brackets",
"motion_args": {"character": "<", "outer": true}},
"context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
},
{ "keys": ["a", "<"], "command": "set_motion", "args": {
"motion": "vi_expand_to_brackets",
"motion_args": {"character": ">", "outer": true}},
"context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
},
// Expand to argument (plugin)
{
"keys": ["a", "a"], "command": "set_motion", "args": {
"motion": "vi_expand_to_arguments",
"motion_args": {"repeat": 1, "outer": true, "multiline": true}
},
"context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
},
{
"keys": ["i", "a"], "command": "set_motion", "args": {
"motion": "vi_expand_to_arguments",
"motion_args": {"repeat": 1, "outer": false, "multiline": true}
},
"context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
},
{
"keys": ["o", "a"], "command": "set_motion", "args": {
"motion": "vi_expand_to_arguments",
"motion_args": {"repeat": 1, "outer": true, "multiline": true}
},
"context": [{"key": "setting.command_mode"}, {"key": "vi_can_enter_text_object"}]
},
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment