Skip to content

Instantly share code, notes, and snippets.

@Apsu
Created March 4, 2020 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Apsu/e7f94d3e8805c6fcd7091733e758dd4a to your computer and use it in GitHub Desktop.
Save Apsu/e7f94d3e8805c6fcd7091733e758dd4a to your computer and use it in GitHub Desktop.
ModalEdit Bindings
"modaledit.keybindings": {
"\n": [
"lineBreakInsert",
"cursorDown",
"cursorHome"
],
" ": "modaledit.enterInsert",
"y": "removeSecondaryCursors",
// Selection mode on/off
"s": "modaledit.toggleSelection",
"S": [
{
"command": "cursorMove",
"args": {
"to": "wrappedLineStart"
}
},
"modaledit.toggleSelection",
"cursorDownSelect",
],
// Delete/replace selection
"d": "deleteRight",
"f": [
"deleteRight",
"modaledit.enterInsert"
],
"D": "deleteAllRight",
"F": [
"deleteAllRight",
"modaledit.enterInsert"
],
// Move up/down/left/right
"i": {
"command": "cursorMove",
"args": "{ to: 'up', select: __selecting }"
},
"j": {
"command": "cursorMove",
"args": "{ to: 'left', select: __selecting }"
},
"k": {
"command": "cursorMove",
"args": "{ to: 'down', select: __selecting }"
},
"l": {
"command": "cursorMove",
"args": "{ to: 'right', select: __selecting }"
},
"u": {
"command": "cursorMove",
"args": "{ to: 'wrappedLineStart', select: __selecting }"
},
"o": {
"command": "cursorMove",
"args": "{ to: 'wrappedLineEnd', select: __selecting }"
},
"U": {
"condition": "__selecting",
"true": "cursorTopSelect",
"false": "cursorTop"
},
"O": {
"condition": "__selecting",
"true": "cursorBottomSelect",
"false": "cursorBottom"
},
// Move to next/previous word
"w": {
"condition": "__selecting",
"true": "cursorWordStartRightSelect",
"false": "cursorWordStartRight"
},
"b": {
"condition": "__selecting",
"true": "cursorWordStartLeftSelect",
"false": "cursorWordStartLeft"
},
"W": [
"cursorRight",
"cursorWordStartRightSelect"
],
"B": [
"cursorLeft",
"cursorWordStartLeftSelect"
],
"p": {
"condition": "__selecting",
"true": "cursorWordPartRightSelect",
"false": "cursorWordPartRight"
},
"P": {
"condition": "__selecting",
"true": "cursorWordPartLeftSelect",
"false": "cursorWordPartLeft"
},
// Move to next previous page
"<": "cursorPageUp",
">": "cursorPageDown",
// Move to next previous definition
"[": "gotoNextPreviousMember.previousMember",
"]": "gotoNextPreviousMember.nextMember",
// Scroll so that current line is in the center of the screen
"m": {
"command": "revealLine",
"args": "{ lineNumber: __line, at: 'center' }"
},
// Expand/reduce selection smartly
"e": "editor.action.smartSelect.expand",
"r": "editor.action.smartSelect.shrink",
"E": [
"cursorWordStartLeft",
"cursorWordEndRightSelect"
],
// Multiple selections
".": "editor.action.addSelectionToNextFindMatch",
",": "editor.action.addSelectionToPreviousFindMatch",
"-": "cursorUndo",
// Jump to matching bracket
"t": "editor.action.jumpToBracket",
// Undo/redo
"z": [
"undo",
"cancelSelection"
],
"Z": "redo",
// Copy/paste
"c": [
"editor.action.clipboardCopyAction"
],
"x": [
"editor.action.clipboardCutAction"
],
"v": "editor.action.clipboardPasteAction",
// Insert new line
"n": [
"editor.action.insertLineAfter",
"modaledit.enterInsert"
],
"N": [
"editor.action.insertLineBefore",
"modaledit.enterInsert"
],
// Append to the end of word/line
"a": [
"modaledit.cancelSelection",
"modaledit.enterInsert"
],
"A": [
"cursorEnd",
"modaledit.enterInsert"
],
// Insert at the beginning of line.
"I": [
"cursorHome",
"modaledit.enterInsert"
],
// Join lines
"J": "editor.action.joinLines",
// Searching
"/": {
"command": "modaledit.search",
"args": {}
},
"?": {
"command": "modaledit.search",
"args": {
"backwards": true
}
},
"h": "modaledit.nextMatch",
"H": "modaledit.previousMatch",
"g": {
"command": "modaledit.search",
"args": {
"acceptAfter": 1
}
},
"G": {
"command": "modaledit.search",
"args": {
"acceptAfter": 1,
"selectTillMatch": true
}
},
// Bookmarks
"!": {
"command": "modaledit.defineBookmark",
"args": {
"bookmark": 0
}
},
"1": {
"command": "modaledit.goToBookmark",
"args": {
"bookmark": 0
}
},
"@": {
"command": "modaledit.defineBookmark",
"args": {
"bookmark": 1
}
},
"2": {
"command": "modaledit.goToBookmark",
"args": {
"bookmark": 1
}
},
"#": {
"command": "modaledit.defineBookmark",
"args": {
"bookmark": 2
}
},
"3": {
"command": "modaledit.goToBookmark",
"args": {
"bookmark": 2
}
},
"$": {
"command": "modaledit.defineBookmark",
"args": {
"bookmark": 3
}
},
"4": {
"command": "modaledit.goToBookmark",
"args": {
"bookmark": 3
}
},
// Quick snippets
"q": {
"a": "modaledit.fillSnippetArgs",
"w": {
"1": {
"command": "modaledit.defineQuickSnippet",
"args": {
"snippet": 1
}
},
"2": {
"command": "modaledit.defineQuickSnippet",
"args": {
"snippet": 2
}
},
"3": {
"command": "modaledit.defineQuickSnippet",
"args": {
"snippet": 3
}
},
"4": {
"command": "modaledit.defineQuickSnippet",
"args": {
"snippet": 4
}
}
},
"1": [
{
"command": "modaledit.insertQuickSnippet",
"args": {
"snippet": 1
}
},
"editor.action.formatDocument"
],
"2": [
{
"command": "modaledit.insertQuickSnippet",
"args": {
"snippet": 2
}
},
"editor.action.formatDocument"
],
"3": [
{
"command": "modaledit.insertQuickSnippet",
"args": {
"snippet": 3
}
},
"editor.action.formatDocument"
],
"4": [
{
"command": "modaledit.insertQuickSnippet",
"args": {
"snippet": 4
}
},
"editor.action.formatDocument"
],
},
// Misc Commands
":": "workbench.action.showCommands",
"'": {
"s": [
"editor.action.clipboardCutAction",
"editor.action.smartSelect.expand",
"deleteRight",
"editor.action.clipboardPasteAction"
],
",": [
"cursorEnd",
{
"command": "editor.action.insertSnippet",
"args": {
"snippet": ","
}
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment