Visual Studio Code - Can "OPEN EDITORS" panel be sorted?
Asked Answered
C

9

36

Sometimes when I'm working I end up with several open tabs. My problem is that every time I need to switch to another file I need to constantly scroll until I find the desired file (which is not always easy to find).

For example, I may have over 30 open files, but I'm currently working only on 3 - 5 on which I constantly switch.

Those files should be kept together at top (sorted by last used/saved) instead on the date they were first opened.

Top tabs aren't sorted either.

Android Studio does a better job on this, so I thought Visual Studio Code may have a preference for it.

Is there a property to change this? I couldn't find a hint on settings.

enter image description here

Clair answered 28/3, 2019 at 5:10 Comment(2)
30 open files is a bare minimum, vscode is nightmarish for this matter... I will go back to jeditRadiolucent
I'd much rather be able to filter/find open editorsFondue
B
58

Update 2020-12-16

With release v1.52.0 being shipped you can sort open editors. From the release notes:

There is a new setting explorer.openEditors.sortOrder to control the sort order in the OPEN EDITORS list.

The values are:

  • editorOrder - Editors are listed in the same order as editor tabs are shown (default).
  • alphabetical - Editors are listed in alphabetical order inside each editor group.

Update 2020-11-16

It seems this will be possible with the next November release v1.52.0 (Reference). This release is expected to be shipped early December 2020.

Original Answer

This is currently not possible.
However the VS Code team is aware of this feature request and it can be tracked here.

Beaudoin answered 28/3, 2019 at 9:15 Comment(7)
Microsoft... What to expect?Cryometer
Finally! A simple but a much needed feature, it spent 4.5 years in the backlog.Alisealisen
Would be really nice if you had the option to keep pinned tabs at the top, and sort the rest. This is better than nothing though, thanks for the tip!Edinburgh
v1.76.2 also supports "fullPath" option.Plain
I must be missing something obvious, but how does this work? What is meant by "explorer.openEditors.sortOrder"? Is this a menu path? Or is this set in a config file somewhere? I don't get it.Mokas
@Mokas This is a setting in the VS Code preferences. Just got to File/Preferences/Settings in the menus. Then put "explorer.openEditors.sortOrder" in the search/filter field at the top of the settings. You should now see an Explorer > Open Editors: Sort Order setting.Wordy
@jason Thank you. This really should be easier to find, and even defaulted to alphabetical in my opinion.Mokas
I
6

It seems the feature request is open for ages.

At least someone created a plugin for sorting all open editors alphabetically. https://marketplace.visualstudio.com/items?itemName=omagerio.tabsort

Indole answered 24/6, 2020 at 8:20 Comment(0)
P
6

As of 1.56.2 this is possible as shown in the answer by @Reid. I see a problem however with steps mentioned by Reid. I am on macOS and following are the steps I had to follow:

  1. Click on Code (Probably File on different OS)
  2. Click on Preferences
  3. Click on Settings
  4. Click on Features
  5. Click on Explorer (This step was missing in answer by Reid)
  6. Scroll down right panel to see Open Editors: Sort Order
  7. Select: alphabetical

Here is the image: enter image description here

One can also search for "Open Editors" or even "sort" in Settings search bar (which I did) to locate this settings quickly. See figure:

enter image description here

Panthia answered 22/5, 2021 at 12:55 Comment(1)
Nice stuff! :-)Tetartohedral
D
5

VSCode 1.64 (Jan. 2022) will include a new sort order: full path

See PR 114470 and commit a7575fb.

open editors: sort by fullPath


But you have also the Sort Editors for Visual Studio Code extension, from Aswin Kumar:

  • Sorts automatically when the new editor is opened.
  • Supports alphabetical and fullpath modes of sorting.
  • Supports reordering of existing editors.
  • Supports sorting in multiple tab groups.
  • Safely ignores pinned editors.

https://static.mcmap.net/file/mcmap/ZG-AbGLDKwfwW7bQXRlAZGyic7MlbmMvan-lan3QWRft/aswinkumar863/sort-editors-vscode/0180d3ee7dfd95d6bd3ee78ca896157efb6e949c/images/preview.gif

Dahlia answered 13/1, 2022 at 7:14 Comment(0)
G
2

Steps:

  1. In the Visual Studio Code menu bar, click on File
  2. Click on Preferences
  3. Click on Settings
  4. Click on Features
  5. Go down to Open Editors: Sort Order
  6. Select: alphabetical

Make sure you are using a release from December 2020 or later. (On the menu bar click Help, then About to see what release you are using.)

Garv answered 4/1, 2021 at 21:13 Comment(2)
Either way that is not optimal, having to work with 3-5 files when you have 30 opened files ordered alphabetically requires to do constant scrolling.Clair
@Garv probably you missed a step after step 4 to select ExplorerPanthia
A
1

Check the Stack Tabs extension: https://marketplace.visualstudio.com/items?itemName=kylepaulsen.stack-tabs

It simply moves the currently active tab to the top.

It would be nice to add a "only stack a tab on save" option though.

Azote answered 25/3, 2021 at 16:54 Comment(0)
A
0

OPEN EDITORS now sorts if a folder was opened.

https://github.com/microsoft/vscode/issues/27286

However, I managed to reproduce OPEN EDITORS not sorting when dragging files into VS Code.

https://github.com/microsoft/vscode/issues/80681#issuecomment-539862813

Awestricken answered 9/10, 2019 at 6:54 Comment(0)
R
0

Yes, you can drag and drop them into any order you like in the "Open Editors" panel of the File Explorer, or you can drag and drop the tabs. Either approach re-orders both as long as you have user preferences set to Explorer > Open Editors: Sort Order => editorOrder

Redtop answered 14/12, 2020 at 21:32 Comment(1)
Yeah but I don't want to be manually ordering each file I open.Clair
I
0
  • Open the VS Code Settings with ctrl+, or command+,
  • Search for explorer.openEditors.sortOrder
  • The default setting is editorOrder. It's possible to change it to alphabetical or fullPath

enter image description here

Indicative answered 29/8, 2023 at 17:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.