Skip to content

Instantly share code, notes, and snippets.

@chriddyp
Last active October 19, 2021 15:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chriddyp/0b33fdd77113c54f96b49097c5b33e58 to your computer and use it in GitHub Desktop.
Save chriddyp/0b33fdd77113c54f96b49097c5b33e58 to your computer and use it in GitHub Desktop.
Custom Sublime Text keybindings for rapid code navigation. No arrow keys required!
[
/* Navigate quickly through a file - Move by horizontally words and vertically by blocks */
{ "keys": ["ctrl+l"], "command": "move", "args": {"by": "subwords", "forward": true}},
{ "keys": ["ctrl+j"], "command": "move", "args": {"by": "subwords", "forward": false}},
{ "keys": ["ctrl+option+k"], "command": "move", "args": {"by": "stops", "forward": true, "empty_line": true}},
{ "keys": ["ctrl+option+i"], "command": "move", "args": {"by": "stops", "forward": false, "empty_line": true}},
/* Fine-grained navigation - Move horizontally by characters and vertically by lines */
{ "keys": ["ctrl+option+l"], "command": "move", "args": {"by": "characters", "forward": true}},
{ "keys": ["ctrl+option+j"], "command": "move", "args": {"by": "characters", "forward": false}},
{ "keys": ["ctrl+k"], "command": "move", "args": {"by": "lines", "forward": true, "empty_line": true}},
{ "keys": ["ctrl+i"], "command": "move", "args": {"by": "lines", "forward": false, "empty_line": true}},
/* Same as above but with shift to select the regions*/
{ "keys": ["ctrl+shift+l"], "command": "move", "args": {"by": "subwords", "forward": true, "extend": true}},
{ "keys": ["ctrl+shift+j"], "command": "move", "args": {"by": "subwords", "forward": false, "extend": true}},
{ "keys": ["ctrl+shift+k"], "command": "move", "args": {"by": "stops", "forward": true, "empty_line": true, "extend": true}},
{ "keys": ["ctrl+shift+i"], "command": "move", "args": {"by": "stops", "forward": false, "empty_line": true, "extend": true}},
{ "keys": ["ctrl+option+shift+l"], "command": "move", "args": {"by": "characters", "forward": true, "extend": true}},
{ "keys": ["ctrl+option+shift+j"], "command": "move", "args": {"by": "characters", "forward": false, "extend": true}},
{ "keys": ["ctrl+option+shift+k"], "command": "move", "args": {"by": "lines", "forward": true, "empty_line": true, "extend": true}},
{ "keys": ["ctrl+option+shift+i"], "command": "move", "args": {"by": "lines", "forward": false, "empty_line": true, "extend": true}},
/* Insert a new line - A closer enter key */
{ "keys": ["ctrl+;"], "command": "insert_snippet", "args": {"contents": "\n"}},
/* Delete the thing - A closer delete key */
{ "keys": ["ctrl+p"], "command": "right_delete"},
/* Switch panes */
{ "keys": ["ctrl+["], "command": "focus_neighboring_group", "args": {"forward": false}},
{ "keys": ["ctrl+]"], "command": "focus_neighboring_group", "args": {"forward": true}},
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment