Visual Studio: set focus to text editor

You can simply do it by hitting one of the following

  • Ctrl + Tab
  • Ctrl + F6

There is no such shortcut for Visual Studio, but you might create one with the help of this AutoHotKey script:

SetTitleMatchMode, 2
#IfWinNotActive, Visual Studio
F4::WinActivate, Visual Studio

I have chosen here the F4 key, but you may choose any other key.

After installing AutoHotKey, put the above text in a .ahk file and double-click it to test. You may stop the script by right-click on the green H icon in the traybar and choosing Exit. To have it run on login, place it in the Startup group.


A solution for returning to the text-editor while Visual Studio has the focus is by using the hotkey Ctrl+Tab.


I find the the action workbench.action.focusActiveEditorGroup

So bind something with that, like ctrl+q

To make the shortcut work through terminal add it to setting.json

// setting.json

"terminal.integrated.commandsToSkipShell": [
    "workbench.action.focusActiveEditorGroup",
 ]