Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sorting files in VS Code Explorer

I'm using VS Code 1.25.1 on Win10. When I open the Explorer icon and look at a list of files in a folder, it shows the files listed alphabetically. I want to sort them by date modified, but I don't see any options to sort by other fields. Are there keyboard shortcuts? Any other options? Thanks.

like image 401
Tom Avatar asked Jul 26 '18 16:07

Tom


People also ask

How do I sort files in File Explorer?

One option to begin sorting files and folders is to right-click or press-and-hold on a free area inside the folder to open a contextual menu. Then, hover or tap on Sort by to reveal the four main sorting options for that view template.

How do I sort alphabetically in VS Code?

Select my lines of text. Press F9. Keep your eyes on the code, you'll see a change. And now it's in alphabetical order.

How do I change the order of folders?

To change the order of a file or folder, click the dots on to the left of the folder or file's name that you're interested in. Dragging while clicking will move the file or folder up and down.


2 Answers

  1. Open user settings (Mac: cmd+, Windows/Linux: ctrl+,).
  2. If you want this new sort order to apply to all VSCode projects, continue to step three. If you want it to apply only to the currently opened folder/workspace, first click on the "Workspace" tab that's directly below the settings search bar, then continue to step three.
  3. Using the settings search bar, search for the following setting ID: explorer.sortOrder.
  4. Click the dropdown for that setting and select your preferred sort order (in your case, modified).
  5. If you'd like to quickly toggle this setting between different values (via a keyboard shortcut), use the Settings Cycler extension.
like image 62
jabacchetta Avatar answered Oct 05 '22 13:10

jabacchetta


A more user friendly approach can be:

  1. Open the workspace settings:

    Ctrl+Shift+p

    And open: Preferences: Open Workspace Settings.

  2. Browse to Features > Explorer using the sidebar.

    Open worlspace settings

  3. Use the Sort Order option to customise sorting.

    Select Sort Order in settings

like image 40
JesusIniesta Avatar answered Oct 05 '22 14:10

JesusIniesta