ctrl-e to switch between two files in visual studio code

Viewed 1026

Most people use alt+TAB to switch between applications on their desktop.

This question is about switching between two windows in Visual Studio Code.

I am used to use ctrl-e to switch between two files in PyCharm and Chrome (via plugin Quick Tab).

Now I would like to do the same in vs-code.

The short cut ctrl-e opens the change file dialog. But if I hint "enter", I stay in the same file. I would have to use the down-arrow key to change the file.

Since I can blindly switch between two files in PyCharm and Chrome with ctrl-e ENTER, I would like to do the same in vs-code. How can I configure it this way?

2 Answers

In your keybindings.json:

File > Preferences > Keyboard Shortcuts. "Open Keyboard Shortcuts" (top right).

{
    "key": "ctrl+e",
    "command": "workbench.action.quickOpenPreviousRecentlyUsedEditorInGroup"
  },
  {
    "key": "ctrl+tab",
    "command": "-workbench.action.quickOpenPreviousRecentlyUsedEditorInGroup"
  },

See this issue: https://github.com/Microsoft/vscode/issues/6923

I found workbench.action.showAllEditorsByMostRecentlyUsed to be the most like JetBrains Rider / Intellij although a extra 'Down' keystroke is needed afterwards. It shows the most-recently-used editors and does not disappear when I release the shortcut chord.

Steps:

  1. File | Preferences | Keyboard Shortcuts
  2. Paste workbench.action.showAllEditorsByMostRecentlyUsed in the search at top
  3. Replace the existing binding with Ctrl+e
  4. Remove other Ctrl+e bindings if necessary
Related