Nahaufnahme einer Person, die mit einem Tablet auf einer Decke sitzt.

TechWiese Blog

Visual Studio Code - Keyboard Shortcuts

22. Juni 2015

Portrait Bild von Patric Boscolo

Patric Boscolo

Dieser Blogbeitrag ist ein Repost und stammt im Original aus dem Know-how-Bereich von TechWiese, dessen Artikel in diesem Blog aufgegangen sind.

Im ersten Teil der Serie zu Microsoft Visual Studio Code haben wir uns die Abgrenzung zu Integrated Development Environments wie Visual Studio auf der einen Seite und zu Editoren wie Sublime auf der anderen angeschaut. Ich wollte an einer zentralen Stelle alle Microsoft Visual Studio Code Keyboard Shortcuts ablegen. Ich werde die meisten davon in den kommenden Blogposts erklären. Und darauf eingehen.

Editor Basics

Diese Liste beschreibt die Keyboard Shortcuts die für alle Basissprachen implementiert sind.

KeyCommandCommand id
Ctrl+XCut line (empty selection)editor.action.clipboardCutAction
Ctrl+CCopy line (empty selection)editor.action.clipboardCopyAction
Shift+DeleteCut lineeditor.action.cutLines
Ctrl+Shift+KDelete Lineeditor.action.deleteLines
Ctrl+EnterInsert Line Beloweditor.action.insertLineAfter
Ctrl+Shift+EnterInsert Line Aboveeditor.action.insertLineBefore
Alt+DownMove Line Downeditor.action.moveLinesDownAction
Alt+UpMove Line Upeditor.action.moveLinesUpAction
Shift+Alt+DownCopy Line Downeditor.action.copyLinesDownAction
Shift+Alt+UpCopy Line Upeditor.action.copyLinesUpAction
Ctrl+Shift+LSelect all occurrences of current selectioneditor.action.selectHighlights
Ctrl+F2Select all occurrences of current wordeditor.action.changeAll
Ctrl+Alt+DownInsert Cursor Beloweditor.action.insertCursorBelow
Ctrl+Alt+UpInsert Cursor Aboveeditor.action.insertCursorAbove
Ctrl+Alt+]Jump to matching bracketeditor.action.jumpToBracket
Ctrl+]Indent Lineeditor.action.indentLines
Ctrl+[Outdent Lineeditor.action.outdentLines
HomeGo to Beginning of LinecursorHome
EndGo to End of LinecursorEnd
Ctrl+EndGo to End of FilecursorBottom
Ctrl+HomeGo to Beginning of FilecursorTop
Ctrl+/Toggle Line Commenteditor.action.commentLine
Shift+Alt+AToggle Block Commenteditor.action.blockComment
Ctrl+FFindactions.find
Ctrl+HReplaceeditor.action.startFindReplaceAction
F3Find Nexteditor.action.nextMatchFindAction
Shift+F3Find Previouseditor.action.previousMatchFindAction
Ctrl+MToggle Use of Tab Key for Setting Focuseditor.action.toggleTabFocusMode

Editor Advanced

Derzeit unterstützen wir hier JavaScript und TypeScript. Für C# kann man die Rich Editing Experience auf eigene Gefahr aktivieren. Sie steht derzeit versteckt zur Verfügung. Um die Editor Experience in C# zu unterstützen gehen Sie folgt vor.

Datenquellen
Microsoft Visual Studio Code User Settings: Menu - File - Preferences - User Settings

In der Kopie der "settings.json" Datei fügen Sie folgenden Code hinzu:

{ "csharp.codeActions" : true }

Nun stehen Ihnen die erweiterten Bearbeitungsmethoden der Roslyn API zur Verfügung. Diese C# Extensions sind noch nicht stabil und werden in einer zukünftigen Version von Microsoft Visual Studio Code automatisch ein Update erhalten.

KeyCommandCommand id
Ctrl+SpaceTrigger Suggesteditor.action.triggerSuggest
Ctrl+Alt+FFormat Codeeditor.action.format
Ctrl+F12Go to Definitioneditor.action.goToDeclaration
Alt+F12Peek Definitioneditor.action.previewDeclaration
Ctrl+.Quick Fixeditor.action.quickFix
Shift+F12Show Referenceseditor.action.referenceSearch.trigger
F2Rename Symboleditor.action.rename
Ctrl+DownReplace with Next Valueeditor.action.inPlaceReplace.down
Ctrl+UpReplace with Previous Valueeditor.action.inPlaceReplace.up
Shift+Alt+RightExpand AST Selecteditor.action.smartSelect.grow
Shift+Alt+LeftShrink AST Selecteditor.action.smartSelect.shrink
KeyCommandCommand id
Ctrl+TShow All Symbolsworkbench.action.showAllSymbols
Ctrl+GGo to Line...workbench.action.gotoLine
Ctrl+EGo to File...workbench.action.quickOpen
Ctrl+Shift+OGo to Symbol...workbench.action.gotoSymbol
Ctrl+Shift+MShow Errors and Warningsworkbench.action.showErrorsWarnings
F8Go to Next Error or Warningeditor.action.marker.next
Shift+F8Go to Previous Error or Warningeditor.action.marker.prev
Ctrl+Shift+PShow All Commandsworkbench.action.showCommands
Ctrl+TabNavigate Historyworkbench.action.openPreviousEditor
Alt+LeftGo Backworkbench.action.navigateBack
Alt+RightGo Forwardworkbench.action.navigateForward

Editor Fenster

KeyCommandCommand id
Ctrl+Shift+NNew Windowworkbench.action.newWindow
Ctrl+Shift+WClose Windowworkbench.action.closeWindow
Ctrl+WClose Editorworkbench.action.closeActiveEditor
Ctrl+`Cycle Between Opened Editorsworkbench.action.cycleEditor
Ctrl+\Split Editorworkbench.action.splitEditor
Ctrl+1Focus into Left Hand Editorworkbench.action.focusFirstEditor
Ctrl+2Focus into Side Editorworkbench.action.focusSecondEditor
Ctrl+3Focus into Right Hand Editorworkbench.action.focusThirdEditor
Ctrl+Alt+LeftFocus into Next Editor on the Leftworkbench.action.focusLeftEditor
Ctrl+Alt+RightFocus into Next Editor on the Rightworkbench.action.focusRightEditor

Datei Management

KeyCommandCommand id
Ctrl+NNew Fileworkbench.action.files.newUntitledFile
Ctrl+Alt+OOpen File...workbench.action.files.openFile
Ctrl+SSaveworkbench.action.files.save
Ctrl+Shift+SSave Allworkbench.action.files.saveAll
Ctrl+Alt+SSave As...workbench.action.files.saveAs

Ansicht und weitere Fenster

KeyCommandCommand id
F11Toggle Full Screenworkbench.action.toggleFullScreen
Ctrl+=Zoom inworkbench.action.zoomIn
Ctrl+-Zoom outworkbench.action.zoomOut
Ctrl+BToggle Sidebar Visibilityworkbench.action.toggleSidebarVisibility
Ctrl+Shift+DShow Debugworkbench.view.debug
Ctrl+Shift+EShow Explorerworkbench.view.explorer
Ctrl+Shift+FShow Searchworkbench.view.search
Ctrl+Shift+JToggle Search Detailsworkbench.action.search.toggleQueryDetails
Ctrl+Shift+COpen New Consoleworkbench.action.terminal.openNativeConsole
Ctrl+Shift+UShow Outputworkbench.action.output.showOutput
Ctrl+U L Show OmniSharp Logomnisharp.show.generalLog
Ctrl+U Ctrl+LShow OmniSharp Log to the Sideomnisharp.show.generalLogOnSide
Ctrl+Shift+VToggle Markdown Previewworkbench.action.markdown.togglePreview

Debugging Shortcuts

KeyCommandCommand id
F9Toggle Breakpointeditor.debug.action.toggleBreakpoint
F5Continueworkbench.action.debug.play
F5Pauseworkbench.action.debug.start
F11Step Intoworkbench.action.debug.stepInto
Shift+F11Step Outworkbench.action.debug.stepOut
F10Step Overworkbench.action.debug.stepOver
Shift+F5Stopworkbench.action.debug.stop

Tasks

KeyCommandCommand id
Ctrl+Shift+BRun Build Taskworkbench.action.tasks.build
Ctrl+Shift+TRun Test Taskworkbench.action.tasks.test

Visual Studio Code herunterladen