Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change the file sorting of VS Code?

In my project I have files labeled as such day1.txt, day2.txt, day3.txt, etc.

Now in my normal file system they are listed in the correct order:

day1.txt day2.txt .... day10.txt day11.txt 

In VS Code they are listed like so:

day1.txt day10.txt day11.txt day2.txt day3.txt 

Is there a setting somewhere to change this? It is driving me mad.

I've given the settings a search and I didn't see any obvious parameter to change that would affect this.

like image 684
jwang Avatar asked Dec 01 '16 21:12

jwang


People also ask

How do I sort my Visual Studio Code?

Select the code you wish to sort in Visual Studio Code. Then hit the key combination Ctrl+P and type the greater than sign ( > ). Next type sort and choose Sort Lines Ascending or choose the Descending option. Now the lines you've previously selected will be sorted by the option you chose.

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.


1 Answers

Yes there is a way.

In your Settings (File → Preferences → Settings) search for: explorer.sortOrder

A small pen will appear on the left side of the setting. Select the way you want to sort the files. There are five options available:

  1. Default
  2. Mixed
  3. Files first
  4. Type
  5. Modified

enter image description here

like image 94
Ayan Avatar answered Sep 30 '22 10:09

Ayan