Switching focus between the editor and the built-in terminal in Visual Studio Code

Does anyone know a keyboard shortcut (Mac and Linux) to switch focus between the editor and the built-in terminal in Visual Studio code.

+62
visual-studio-code
Mar 14 '17 at 21:29
source share
4 answers

While there are many modal switches and navigation shortcuts for VS Code, it doesn’t exist specifically for "moving from the editor to the terminal and back." However, you can perform two steps by overloading key and using when clause .

 // Toggle between terminal and editor focus { "key": "ctrl+`", "command": "workbench.action.terminal.focus"}, { "key": "ctrl+`", "command": "workbench.action.focusActiveEditorGroup", "when": "terminalFocus"} 

With these shortcuts, I will focus between the editor and the built-in terminal using the same keystroke.

+140
Mar 25 '17 at 5:10
source share
β€” -

A bit late in the game, but I configured mine as the following in keybindings.json :

 { "key": "ctrl+`", "command": "workbench.action.terminal.focus", "when": "editorTextFocus" }, { "key": "ctrl+`", "command": "workbench.action.focusActiveEditorGroup", "when": "terminalFocus" }, { "key": "alt+`", "command": "workbench.action.terminal.toggleTerminal" } 

I need separate keys to open / close the terminal and switch focus between windows.

+11
Sep 12 '17 at 18:41
source share

The default key for switching the integrated terminal is "Ctrl +" according to the vscode keyboard shortcuts. If you do not like this shortcut, you can change it in the keywords file by adding something similar to:

 { "key": "ctrl+l", "command": "workbench.action.terminal.toggleTerminal" } 

It seems that the default snap is not used to snap the bottom pane. So, if you do not want to switch the bottom panel, you need to add something similar to the following to the binding file in the file:

 { "key": "ctrl+t", "command": "workbench.action.focusPanel" } 
+6
Mar 14 '17 at 22:03
source share

I configured mine as the next one, as I found that ctrl + `is a bit hard to press.

 { "key": "ctrl+k", "command": "workbench.action.focusActiveEditorGroup", "when": "terminalFocus" }, { "key": "ctrl+j", "command": "workbench.action.terminal.focus", "when": "!terminalFocus" } 

I also set up the following to move between a group of editors.

 { "key": "ctrl+h", "command": "workbench.action.focusPreviousGroup", "when": "!terminalFocus" }, { "key": "ctrl+l", "command": "workbench.action.focusNextGroup", "when": "!terminalFocus" } 

By the way, I configured Caps Lock on ctrl on Mac with System Preferences => keyboard =>Modifier Keys .

+5
Sep 27 '17 at 3:49 on
source share



All Articles