Vscode: Allow to switch between recently used editors regardless of which group they are in

Created on 4 Dec 2016  路  8Comments  路  Source: microsoft/vscode

Please implement commands to switch between recently used editors regardless of which group the editors are in. Currently, it seems as though there is only a command to switch between recently used editors in a group.

The workaround suggested by bpasero in issue #16238 is far less than ideal. It takes too many keystrokes to switch between the active document in each group.

Currently, I see the following two commands:

  • workbench.action.openNextRecentlyUsedEditorInGroup
  • workbench.action.openNextRecentlyUsedEditorInGroup

However, I would like to see two additional commands:

  • workbench.action.openNextRecentlyUsedEditor
  • workbench.action.openPreviousRecentlyUsedEditor

Thank you.

feature-request verification-needed verified

Most helpful comment

@bpasero I don't care as much about whether you display an MRU list or not. If it flashes on the screen when I use Ctrl+Tab the way that it happens currently, when switching between editors within a single group...that's fine.

As long as the previously MRU editor is highlighted by default (no matter what group it's in), so that when I let go of Ctrl+Tab - the previous MRU editor is active.

So, workbench.action.showAllEditors almost does what we want except for these things:

  • The previously active editor is not highlighted by default
  • Ctrl+Tab does not cycle through that list in MRU order (So yeah, I guess you'd have to sort it in MRU order for that to happen...)

All 8 comments

@waynebloss to be clear, you want what workbench.action.showAllEditors does but in MRU order?

@bpasero I just want to switch back to whatever the previously active document was without any further ceremony and I'd like to do it without bringing up an MRU list of any kind if that is possible (For example, like you switch between open editors in the full Visual Studio product...or the way you switch between tabs in Chrome except Chrome doesn't remember the most recently used and it just cycles left to right or right to left...)

So, if the previously active editor is in group 1, but the active editor is in group 2...I want to just hit Ctrl+Tab to switch back.

Likewise, if both editors are in the same group...I want to just hit Ctrl+Tab to switch between them.

@bpasero So to be crystal clear - workbench.action.showAllEditors does not do at all what I want.

Are you suggesting that here and other places because you think it's exactly what we're asking for or because you're pushing us to change how we work so that we can use something that exists instead of creating a new feature?

I'm just trying to understand if you're having a hard time understanding the requested feature or not...I can give you more details and visuals on exactly what's being asked if you like...

@bpasero I see that in #6605 you also mentioned a completely different tactic for using Ctrl+Tab quoted below...however, this does not work either - it still shows an MRU list which I don't want, but more importantly - opening a file from that list ignores the fact that the same file is already opened in another group...

Ctrl+Tab to navigate in entire editor history

You can change keybindings for Ctrl+Tab to show you a list of all opened editors from the history independent from the editors that are opened in a stack. Edit your keybindings and add the following:

{ "key": "ctrl+tab", "command": "workbench.action.openPreviousEditorFromHistory" },
{ "key": "ctrl+tab", "command": "workbench.action.quickOpenNavigateNext", "when": "inQuickOpen" },

@bpasero I don't care as much about whether you display an MRU list or not. If it flashes on the screen when I use Ctrl+Tab the way that it happens currently, when switching between editors within a single group...that's fine.

As long as the previously MRU editor is highlighted by default (no matter what group it's in), so that when I let go of Ctrl+Tab - the previous MRU editor is active.

So, workbench.action.showAllEditors almost does what we want except for these things:

  • The previously active editor is not highlighted by default
  • Ctrl+Tab does not cycle through that list in MRU order (So yeah, I guess you'd have to sort it in MRU order for that to happen...)

@waynebloss I found that the following combination actually does what you (and I) want:

{ "command": "workbench.action.openPreviousEditorFromHistory" },
{ "command": "workbench.action.acceptSelectedQuickOpenItem" },

Fixed via https://github.com/Microsoft/vscode/commit/e368b34ac39fc1ca51e553d91a08ae2cf13048d2

There are two new commands/actions:

  • workbench.action.openPreviousRecentlyUsedEditor: Open Next Recently Used Editor
  • workbench.action.openNextRecentlyUsedEditor: Open Previous Recently Used Editor

These actions should behave the same as their similar actions "Open Next Recently Used Editor In Group" and "Open Previous Recently Used Editor in Group" but they work across groups.

To verify: make sure you can use these actions to navigate back and forward in editor history, even across multiple editor groups.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings