sebastianmc172k downloadsManual or automatic config-driven reordering and sorting of files and folders in File Explorer.
This is a simple version of README which highlights the basic scenario and most commonly used feature
Take full control of the order of your notes and folders by:
The simplest usage scenario is to sort items via drag and drop:
Another typical scenario is to apply different sorting order per folder:

For detailed instructions and videos go to wiki documentation
More advanced capabilities available through config-driven sorting:
sorting-spec: key in note properties (aka metadata aka frontmatter aka YAML)Create a new note named sortspec in the folder for which you want to configure the sorting
In the top of the new note put the following YAML front matter text:
---
sorting-spec: |
order-desc: a-z
---
Click the ribbon button (
or
on phone) to tell the plugin to read the sorting specification and apply it.
The sorting should be applied to the folder. On desktops and tablets the ribbon icon should turn (
)
!!! Done! !!!
You should see the files and sub-folders in your folder sorted in reverse alphabetical order, folders and files intermixed
An illustrative image which shows the reverse alphabetical order applied to the root folder of some vault:
Remarks:
- your new
sortspecnote should look like this except for the syntax highlighting, which could differ- you will notice that the folders and files are treated equally and thus intermixed
- the behavior depends on what files and subfolders you have in your folder
- changing the sorting order via the standard Obsidian UI button won't affect your folder, unless...
- ...unless you deactivate the custom sorting via clicking the ribbon button to make it
- for clarity: the underlying file name of the note
sortspecis obviouslysortspec.md- in case of troubles refer to the TL;DR section of advanced README.md
- feel free to experiment! The plugin works in a non-destructive fashion, and it doesn't modify the content of your vault. It only changes the order in which the files and folders are displayed in File Explorer
- indentation matters in YAML -> the two leading spaces in
order-desc: a-zare intentional and required- this common example only touches the surface of the rich capabilities of this custom sorting plugin. For more details go to advanced version of README.md
This comes from the suggestion by TheOneLight in this discussion
Take the instructions from the Basic scenario 1 above and replace the YAML content with:
---
sorting-spec: |
My first folder name
My second folder name
My first file name
My second file name
// ... and continue so in the desired order
---
This will enforce the order as you listed inside the YAML
The newly introduced YAML properties editor (Obsidian 1.4 and newer) can make editing the multi-line text properties tricky and confusing. There are short videos here How to create or edit a multi‐line property in Obsidian? which could be helpful:
shift+enter does the magic here)source view mode (the classic way, as you did prior to Obsidian 1.4)The list of automatic sorting orders includes:
order-asc: a-z - alphabetical order, aka natural order-desc: a-z - reverse alphabetical order, aka reverse natural, aka descending alphabetical order-asc: true a-z - true alphabetical order order-desc: true a-z - true reverse alphabetical order, aka descending true alphabetical order-asc: created - by creation date order-desc: created - by creation date, descending order-asc: advanced created - by creation date, also for folders order-desc: advanced created - by creation date, descending, also for folders order-asc: modified - by modification date order-desc: modified - by modification date, descending order-asc: advanced modified - by modification date, also for folders order-desc: advanced modified - by modification date, descending, also for foldersRemarks: In the above list the
-ascstems fromAscendingand-descstems fromDescending. Theorder-desc:andorder-asc:can be replaced with more concise<and>variants, for example< a-zinstead oforder-asc: a-z
...and additional orders and modifiers:
standard, ui selected - apply whatever order is selected in Obsidian UI of File Explorerby-bookmarks-order - reflect the order of selected group of items in Bookmarksfiles-first or folders-first - self explainingvsc-unicode or unicode-charcode - tricky for geeksby-metadata: modifier to use specific metadata for sortingusing-extractor: in connection with by-metadata: to use only part of metadata value, for example a date in specified format, separator to specify two levels of sorting. When combining folder-level and group-level sorting this allows for up to 4 sorting levelsadvanced recursive modified or advanced recursive created - advanced variants of advanced modified and advanced created.
Use with care on larger vaults because the deep scanning of folder descendants can have impact on performance on mobile devices\R+, \.R+ or \-R+ for Roman numbers\d+, \.d+ or \-d+ for plain numbers or compound plain numbers\a+ to extract the last word from title\[yyyy-mm-dd], \[yyyy-dd-mm], \[dd-Mmm-yyyy], \[mm-dd-yyyy], \[dd-mm-yyyy], \[Mmm-dd-yyyy], \[yyyy-Www (mm-dd)], \[yyyy-Www] or \[yyyy-WwwISO] to extract dates in various formatsIf a folder contains files of various types, e.g. images and .md notes you can extend
the sorting rules onto file name extensions and, for example, push JPG files before PNG.
Use the a-z. or true a-z. syntax to enable that behavior for alphabetical or true alphabetical order.
The manual ordering of notes and folders can have two meanings:
Click the ribbon icon to toggle the plugin between enabled and suspended states.
States of the ribbon icon on large-screen devices (desktops, laptops and tablets like iPad):
On small-screen mobile devices (phones) the icon is static:
For more details on the icon states refer to Ribbon icon section of the advanced-README.md
The plugin could and should be installed from the official Obsidian Community Plugins list at https://obsidian.md/plugins or directly in the Obsidian app itself. Search the plugin by its name 'CUSTOM FILE EXPLORER SORTING'
For other installation methods refer to Installing the plugin section of advanced-README.md
Thanks to Nothingislost for the monkey-patching ideas of File Explorer in obsidian-bartender
Do you want to have a nice-looking horizontal separators in File Explorer like this?

If so, head on to Instruction and more context
by @replete
Quick & easy!
This feature is not dependent on the Custom Sorting plugin. At the same time I'm mentioning it here because it is a side effect of a discussion with @replete. We were considering a direct support of the Separators in the plugin. Eventually this boiled down to a very concise and smart CSS-snippet based solution, independent of the plugin. Go, see, copy to the CSS-snippets in Obsidian and enjoy the more grouped look