Vscode: Add commands to navigate tabs in MRU order without picker

Created on 10 Nov 2016  路  10Comments  路  Source: microsoft/vscode

Im trying to execute the command to change the focus to last opened tab.
workbench.action.openNextRecentlyUsedEditorInGroup

But it opens the menu rather than showing the last tab.

*duplicate workbench-history workbench-tabs

Most helpful comment

@bpasero I don't think #15225 is actually the same as this. That issue discussed cycling through the editors in the group in tab order, whereas if I understand correctly, what @shanalikhan was looking for was the equivalent of openNextRecentlyUsedEditorInGroup (i.e., MRU order). I'm facing the same issue myself at the moment, where I'd like a shortcut to swap quickly back and forth between two files. workbench.action.openNextRecentlyUsedEditorInGroup would do that, except for the fact that it also pops up the picker.

All 10 comments

@shanalikhan this action is specifically only for using a picker for choosing the next editor. What you seem to want is actions to just navigate to the next tab in MRU order without having the picker UI.

My extension opens new tab / page which i want to hide.
workbench.action.nextEditorInGroup works for some scenario but doesnt work on mine.

First Scenario : ( works fine )
settings.json is only opened.
My extension create new page and add text and through this command i am switched to settings.json - works Fine !

Second Scenario : ( does not work )

settings.json is opened, 2nd file , say abc.txt is opened and switched current tab from settings.json to abc.txt , and when my extension create new page and when this command hits, it should remain in abc.txt but it goes to settings.json.

@bpasero I don't think #15225 is actually the same as this. That issue discussed cycling through the editors in the group in tab order, whereas if I understand correctly, what @shanalikhan was looking for was the equivalent of openNextRecentlyUsedEditorInGroup (i.e., MRU order). I'm facing the same issue myself at the moment, where I'd like a shortcut to swap quickly back and forth between two files. workbench.action.openNextRecentlyUsedEditorInGroup would do that, except for the fact that it also pops up the picker.

I'd like to propose two new actions for this purpose:

workbench.action.nextRecentlyUsedEditorInGroup
workbench.action.previousRecentlyUsedEditorInGroup

To be clear, these would use the same order as the existing open* versions

workbench.action.openNextRecentlyUsedEditorInGroup
workbench.action.openPreviousRecentlyUsedEditorInGroup

, but they would perform an instant tab switch, like

workbench.action.nextEditorInGroup
workbench.action.previousEditorInGroup

Upvote! I'm looking for the equivalent of "Alt+W, 2" in Visual Studio (which switches to the most recently opened file... "Alt+W,3" goes to the next most recently accessed one, etc). I use this all day every day, literally every few seconds.

Currently I'm using workbench.action.openPreviousEditorFromHistory which is almost exactly what I want... except it has the undesired behaviour of reopening files that I have deliberately closed. If that could be disabled with a boolean setting then I would have exactly what I need (particularly since you can keep Ctrl held down and press Tab multiple times to step back further in the history, which is ideal).

Related: workbench.action.openPreviousRecentlyUsedEditorInGroup seems not to work. As near as I can tell it switches to a random editor... clearly it doesn't, but I can't spot the pattern!

I too would love to be able to switch tabs in MRU order without having the picker show up. Every time I see the picker it just slows me down. I'm trying to get used to it, but if I could have the same tab switching behavior without the picker that would be ideal.

any update on this?

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

Was this page helpful?
0 / 5 - 0 ratings