Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save elias19r/2d9d8b3432fc2711cf252f67206d19e4 to your computer and use it in GitHub Desktop.

Select an option

Save elias19r/2d9d8b3432fc2711cf252f67206d19e4 to your computer and use it in GitHub Desktop.
[
{
"key": "cmd+w",
"command": "-workbench.action.closeGroup",
"when": "activeEditorGroupEmpty && multipleEditorGroups"
},
{
"key": "cmd+w",
"command": "-workbench.action.closeWindow",
"when": "!editorIsOpen && !multipleEditorGroups"
},
{
"key": "cmd+; f",
"command": "railsTestRunner.runAllTestsInFile"
},
{
"key": "cmd+; c",
"command": "railsTestRunner.runTestAtLine"
},
{
"key": "cmd+right",
"command": "-cursorEnd",
"when": "textInputFocus"
},
{
"key": "cmd+left",
"command": "-cursorHome",
"when": "textInputFocus"
},
{
"key": "cmd+right",
"command": "cursorWordEndRight",
"when": "textInputFocus"
},
{
"key": "alt+right",
"command": "-cursorWordEndRight",
"when": "textInputFocus"
},
{
"key": "shift+cmd+right",
"command": "cursorWordEndRightSelect",
"when": "textInputFocus"
},
{
"key": "shift+alt+right",
"command": "-cursorWordEndRightSelect",
"when": "textInputFocus"
},
{
"key": "cmd+left",
"command": "cursorWordLeft",
"when": "textInputFocus"
},
{
"key": "alt+left",
"command": "-cursorWordLeft",
"when": "textInputFocus"
},
{
"key": "shift+cmd+left",
"command": "cursorWordLeftSelect",
"when": "textInputFocus"
},
{
"key": "shift+alt+left",
"command": "-cursorWordLeftSelect",
"when": "textInputFocus"
},
{
"key": "cmd+end",
"command": "cursorBottom",
"when": "textInputFocus"
},
{
"key": "cmd+down",
"command": "-cursorBottom",
"when": "textInputFocus"
},
{
"key": "shift+cmd+end",
"command": "cursorBottomSelect",
"when": "textInputFocus"
},
{
"key": "shift+cmd+down",
"command": "-cursorBottomSelect",
"when": "textInputFocus"
},
{
"key": "cmd+home",
"command": "cursorTop",
"when": "textInputFocus"
},
{
"key": "cmd+up",
"command": "-cursorTop",
"when": "textInputFocus"
},
{
"key": "shift+cmd+home",
"command": "cursorTopSelect",
"when": "textInputFocus"
},
{
"key": "shift+cmd+up",
"command": "-cursorTopSelect",
"when": "textInputFocus"
},
{
"key": "cmd+delete",
"command": "-deleteAllRight",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "cmd+backspace",
"command": "-deleteAllLeft",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "alt+delete",
"command": "-deleteWordRight",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "ctrl+alt+delete",
"command": "-deleteWordPartRight",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "alt+backspace",
"command": "-deleteWordLeft",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "ctrl+alt+backspace",
"command": "-deleteWordPartLeft",
"when": "textInputFocus && !editorReadonly"
}
]
/*
Reference:
- https://gist.github.com/trusktr/1e5e516df4e8032cbc3d
- https://gist.github.com/zsimic/1367779
~/Library/KeyBindings/DefaultKeyBinding.Dict
Here is a rough cheatsheet for syntax.
Key Modifiers
^ : Ctrl
$ : Shift
~ : Option (Alt)
@ : Command (Apple)
# : Numeric Keypad
Non-Printable Key Codes
Standard
Up Arrow: \UF700 Backspace: \U0008 F1: \UF704
Down Arrow: \UF701 Tab: \U0009 F2: \UF705
Left Arrow: \UF702 Escape: \U001B F3: \UF706
Right Arrow: \UF703 Enter: \U000A ...
Insert: \UF727 Page Up: \UF72C
Delete: \UF728 Page Down: \UF72D
Home: \UF729 Print Screen: \UF72E
End: \UF72B Scroll Lock: \UF72F
Break: \UF732 Pause: \UF730
SysReq: \UF731 Menu: \UF735
Help: \UF746
OS X
delete: \U007F
*/
{
"@\UF72B" = "moveToEndOfDocument:"; /* Cmd + End */
"@$\UF72B" = "moveToEndOfDocumentAndModifySelection:"; /* Shift + Cmd + End */
"@\UF729" = "moveToBeginningOfDocument:"; /* Cmd + Home */
"@$\UF729" = "moveToBeginningOfDocumentAndModifySelection:"; /* Shift + Cmd + Home */
"\UF729" = "moveToBeginningOfLine:"; /* Home */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */
"\UF72B" = "moveToEndOfLine:"; /* End */
"$\UF72B" = "moveToEndOfLineAndModifySelection:"; /* Shift + End */
"\UF72C" = "pageUp:"; /* PageUp */
"\UF72D" = "pageDown:"; /* PageDown */
"@\UF702" = "moveWordBackward:"; /* Cmd + LeftArrow */
"@$\UF702" = "moveWordBackwardAndModifySelection:"; /* Shift + Cmd + Leftarrow */
"@\U007F" = "deleteWordBackward:"; /* Cmd + Backspace */
"@\UF703" = "moveWordForward:"; /* Cmd + RightArrow */
"@$\UF703" = "moveWordForwardAndModifySelection:"; /* Shift + Cmd + Rightarrow */
"@\UF728" = "deleteWordForward:"; /* Cmd + Delete */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment