Skip to content

Instantly share code, notes, and snippets.

@UnJavaScripter
Last active June 14, 2020 12:24
Show Gist options
  • Save UnJavaScripter/65b25803166aa3e158a37776163a90bf to your computer and use it in GitHub Desktop.
Save UnJavaScripter/65b25803166aa3e158a37776163a90bf to your computer and use it in GitHub Desktop.
VS Code keyboard shortcuts
[
// Move current line up
{ "key": "ctrl+shift+up", "command": "editor.action.moveLinesUpAction",
"when": "editorFocus" },
// Move current line down
{ "key": "ctrl+shift+down", "command": "editor.action.moveLinesDownAction",
"when": "editorFocus" },
// Create new cursor above
{ "key": "alt+up", "command": "editor.action.insertCursorAbove",
"when": "editorTextFocus" },
// Create new cursor below
{ "key": "alt+down", "command": "editor.action.insertCursorBelow",
"when": "editorTextFocus" },
// Comment toggle
{ "key": "ctrl+[Backslash]", "command": "editor.action.commentLine",
"when": "editorTextFocus" },
// Duplicate current line
{ "key": "ctrl+shift+d", "command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus" },
// Terminal focus from editor
{ "key": "ctrl+t", "command": "workbench.action.terminal.focus",
"when": "!terminalFocus" },
// Editor focus from terminal
{ "key": "ctrl+t", "command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus" },
// Editor focus from terminal (repeated to avoid my usual mistakes)
{ "key": "ctrl+z", "command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus" },
// New terminal
{ "key": "ctrl+n", "command": "workbench.action.terminal.new",
"when": "terminalFocus" },
// Close terminal tab
{ "key": "ctrl+w", "command": "workbench.action.terminal.kill",
"when": "terminalFocus" },
// Tabs
{ "key": "ctrl+tab", "command": "workbench.action.nextEditor",
"when": "!terminalFocus" },
{ "key": "ctrl+shift+tab", "command": "workbench.action.previousEditor",
"when": "!terminalFocus" },
// Tabs - doesn't work yet
{ "key": "ctrl+tab", "command": "workbench.action.terminal.focusNext",
"when": "terminalFocus" },
{ "key": "ctrl+shift+tab", "command": "workbench.action.focusPrevious",
"when": "terminalFocus" }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment