Custom File Explorer sorting

by SebastianMC
5
4
3
2
1
Score: 81/100

Description

The Custom File Explorer sorting plugin enhances the organization of notes and folders within Obsidian by providing flexible sorting options. Users can arrange items manually through drag-and-drop or configure custom sorting rules via YAML front matter. The plugin supports various ordering methods, including alphabetical, numerical, date-based, and metadata-driven sorting. It allows different sorting rules for individual folders and provides inheritance capabilities. Users can mix manual and automatic ordering, group items by attributes, and utilize bookmarks for easy access.

Reviews

No reviews yet.

Stats

445
stars
172,510
downloads
29
forks
1,307
days
61
days
289
days
44
total PRs
5
open PRs
3
closed PRs
36
merged PRs
137
total issues
14
open issues
123
closed issues
86
commits

Latest Version

10 months ago

Changelog

#216 - bugfix for broken sorting by metadata when one or both metadata are boolean false

README file from

Github

This is a simple version of README which highlights the basic scenario and most commonly used feature

The long and much more detailed advanced-README.md is here


Freely arrange notes and folders in File Explorer (https://obsidian.md plugin)

Take full control of the order of your notes and folders by:

  • config-driven sorting with wide variety of options, allowing the fullest range of fine-grained ordering, or
  • drag and drop via bookmarks integration.

The simplest usage scenario is to sort items via drag and drop:

Drag and drop ordering simplest example

Another typical scenario is to apply different sorting order per folder:

Idea of different sorting order per folder

For detailed instructions and videos go to wiki documentation

More advanced capabilities available through config-driven sorting:

  • treat folders and files equally or distinctively, you decide
  • fine-grained folder-level or even notes-group-level specification
  • support for fully manual order
    • list notes and folders names explicitly in desired order
    • use prefixes or suffixes notation only for more flexibility
    • wildcard names matching supported
    • extract numbers and dates from titles and sort by them
  • group and sort notes and folders by notes custom metadata
  • support for automatic sorting by standard and non-standard rules
  • mixing manual and automatic ordering also supported
  • order by compound numbers in prefix, in suffix (e.g. date in suffix) or inbetween
  • Roman numbers support, also compound Roman numbers
  • grouping by prefix or suffix or prefix and suffix
    • different sorting rules per group even inside the same folder
  • simple to use yet versatile configuration options
  • configuration stored directly in your note(s) front matter
    • use a dedicated sorting-spec: key in note properties (aka metadata aka frontmatter aka YAML)
  • folders not set up for the custom order remain on the standard Obsidian sorting
  • support for imposing inheritance of order specifications with flexible exclusion and overriding logic

Basic scenario 1: set the custom sorting order for a specific folder

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 (Inactive or Static icon 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 (Active)

!!! 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:

Basic example


Remarks

Remarks:

  • your new sortspec note 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 Inactive
  • for clarity: the underlying file name of the note sortspec is obviously sortspec.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-z are 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

Basic scenario 2: explicitly list folders and files in the order which you want

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


Editing multi-line properties in the new YAML properties editor (Obsidian 1.4 and newer)

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:

  • how to edit the multi-line text properties in Obsidian properties editor (shift+enter does the magic here)
  • how to edit the multi-line text properties in Obsidian source view mode (the classic way, as you did prior to Obsidian 1.4)

Basic automatic sorting methods

The list of automatic sorting orders includes:

  • order-asc: a-z - alphabetical order, aka natural
    • 'a' goes before 'z' and numbers are treated specifically and 2 goes before 11
  • order-desc: a-z - reverse alphabetical order, aka reverse natural, aka descending alphabetical
    • 'z' goes before 'a' and numbers are treated specifically and 11 goes before 2
  • order-asc: true a-z - true alphabetical order
    • 'a' goes before 'z' and numbers are treated as texts and 11 goes before 2
  • order-desc: true a-z - true reverse alphabetical order, aka descending true alphabetical
    • 'z' goes before 'a' and numbers are treated as texts and 11 goes before 2
  • order-asc: created - by creation date
    • the oldest notes go first. Sub-folders pushed to the top, alphabetically
  • order-desc: created - by creation date, descending
    • the newest notes go first. Sub-folders pushed to the bottom, alphabetically
  • order-asc: advanced created - by creation date, also for folders
    • the oldest notes and sub-folders go first
    • for sub-folders the creation date of the oldest contained note is taken as folder's creation date
    • sub-folders not containing any notes are pushed to the top, alphabetically
  • order-desc: advanced created - by creation date, descending, also for folders
    • the newest notes and sub-folders go first
    • for sub-folders the creation date of the newest contained note is taken as folder's creation date
    • sub-folders not containing any notes are pushed to the bottom, alphabetically
  • order-asc: modified - by modification date
    • the most dusty notes go first. Sub-folders pushed to the top, alphabetically
  • order-desc: modified - by modification date, descending
    • the most recently modified notes go first. Sub-folders pushed to the bottom, alphabetically
  • order-asc: advanced modified - by modification date, also for folders
    • the most dusty notes and sub-folders go first
    • for sub-folders the modification date of the most dusty contained note is taken as folder's modification date
    • sub-folders not containing any notes are pushed to the top, alphabetically
  • order-desc: advanced modified - by modification date, descending, also for folders
    • the most recently modified notes and sub-folders go first
    • for sub-folders the modification date of the most recently modified contained note is taken as folder's modification date
    • sub-folders not containing any notes are pushed to the bottom, alphabetically

Remarks: In the above list the -asc stems from Ascending and -desc stems from Descending. The order-desc: and order-asc: can be replaced with more concise < and > variants, for example < a-z instead of order-asc: a-z

...and additional orders and modifiers:

  • standard, ui selected - apply whatever order is selected in Obsidian UI of File Explorer
  • by-bookmarks-order - reflect the order of selected group of items in Bookmarks
  • files-first or folders-first - self explaining
  • vsc-unicode or unicode-charcode - tricky for geeks
  • by-metadata: modifier to use specific metadata for sorting
  • using-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 levels
  • advanced 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

Patterns to extract numbers or dates from file and folder titles

  • \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 formats

Sorting by note name and note name with file extension

If 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.

Manual sorting

The manual ordering of notes and folders can have two meanings:

  • by drag & drop, and this is done via Bookmarks integration, enabled by default, or
  • by explicitly listing files and folders in the desired order. This is done via the sorting configuration. Refer to the TL;DR section of advanced README.md for examples and instructions

Ribbon icon

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):

  • Inactive Custom sorting NOT applied. Plugin suspended or enabled, but the custom sorting was not (yet) applied.
  • Active Plugin active, custom sorting applied.
  • Error Syntax error in custom sorting configuration.
  • General Error Plugin suspended. Critical error like File Explorer view not available.
  • Static icon (Only on large-screen mobile devices like iPad). Plugin enabled. but the custom sorting was not applied.

On small-screen mobile devices (phones) the icon is static:

  • Static icon The icon acts as a button to toggle between enabled and disabled. Its appearance doesn't change

For more details on the icon states refer to Ribbon icon section of the advanced-README.md

Small screen mobile devices remarks

  • you might need to activate the custom sorting on your mobile separately, even if on a shared vault the custom sorting was activated on desktop
  • the Obsidian command palette being easily available (swipe down gesture on small-screen mobiles) allows for quick steering of the plugin via commands: sort-on and sort-off. This could be easier than navigating to and expanding the ribbon
  • the ribbon icon is static (Static icon) and doesn't reflect the state of custom sorting. You can enable the plugin state changes notifications in settings, for the mobile devices only

Installing the plugin

From the official Obsidian Community Plugins page

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

Credits

Thanks to Nothingislost for the monkey-patching ideas of File Explorer in obsidian-bartender

...and before you go, maybe you'd like the visual separators in File Explorer?

Do you want to have a nice-looking horizontal separators in File Explorer like this?

separators

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

Buy Me A Coffee

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
Binary File Manager
4 years ago by qawatake
An Obsidian plugin to manage binary files
Auto Card Link
4 years ago by Nekoshita Yuki
Folder Index
4 years ago by turulix
Media DB Plugin
4 years ago by Moritz Jung
A plugin that can query multiple APIs for movies, series, anime, games, music and wiki articles, and import them into your vault.
Metadata Menu
4 years ago by mdelobelle
For data management enthusiasts : type and manage the metadata of your notes.
Bulk Rename
4 years ago by Oleg Lustenko
Meta Bind Plugin
4 years ago by Moritz Jung
A plugin for Obsidian to make your notes interactive with inline input fields, metadata displays, and buttons.
Todo sort
3 years ago by Ryan Gomba
A plugin for Obsidian that sorts todos within a note
Note aliases
3 years ago by Pulsovi
This plugin manages wikilinks aliases and save them on the aliases list of the linked note
April's Automatic Timelines
3 years ago by April Gras
Simple timeline generator plugin for story tellers using obsidian
Linked Data Vocabularies
3 years ago by kometenstaub
Add linked data to the YAML of your Obsidian notes.
Attachment Management
3 years ago by trganda
Attachment Management of Obsidian
Notes dater
3 years ago by Paul Treanor
Adds created_on and updated_on dates of the active note to status bar
Bulk Exporter
3 years ago by symunona
Bulk export Markdown filtered, renamed and sorted by front matter metadata into a new structure.
Attachment Manager
3 years ago by chenfeicqq
Attachment folder name binding note name, automatically rename, automatically delete, show/hide.
Copy Metadata
3 years ago by wenlzhang
An Obsidian plugin to copy metadata to clipboard and insert it into file name.
Auto Tag
3 years ago by Control Alt
Easily generate relevant tags for your Obsidian notes.
Frontmatter generator
3 years ago by Hananoshika Yomaru
A plugin for Obsidian that generates frontmatter for notes
File Index
2 years ago by Steffo
Obsidian plugin to create a metadata file about the files present in the Vault
Sort Frontmatter
2 years ago by Kanzi
Sort frontmatter automatically
Time Things
2 years ago by Nick Winters
Show clock, track time spent editing a note, and track the last time a note has been edited.
Additional Icons
2 years ago by Matthew Turk
Add additional iconsets to Obsidian
Enhanced tables
2 years ago by pistacchio
A plugin for Obsidian to add advanced controls (like sorting and filtering) to standard markup tables
Metadata Icon
2 years ago by Benature
change metadata entry icon
Alias Management
2 years ago by WithMarcel
Identify duplicate notes based on similar aliases and filenames in Obsidian.
Project Browser
2 years ago by Dale de Silva
Update Time
2 years ago by Sébastien Dubois
Obsidian plugin that updates front matter to include creation and last update times
Folder by tags distributor
2 years ago by RevoTale
Automatically group Obsidian notes into folder by tags specified in note.
Line Arrange
2 years ago by Chitwan Singh
Obsidian Plugin For Arranging Lines.
Watched-Metadata
2 years ago by Nail Ahmed
Watches for changes in metadata and updates the note content accordingly.
Image Metadata
2 years ago by alexeiskachykhin
Adds image metadata editing capabilities to Obsidian
Virus Total Enrichment
2 years ago by ytisf
An Obsidian plugin to enrich a note with VirusTotal API.
Onto Tracker
2 years ago by Jacob Hart
Plugin for obsidian allowing project management with ontologies.
Supercharged Links
5 years ago by mdelobelle
obsidian plugin to add attributes and context menu options to internal links
MetaEdit
5 years ago by Christian B. B. Houmann
MetaEdit for Obsidian
Daily Named Folder
5 years ago by Nemo Andrea
Like daily note, but nested in a daily folder and some more improvements
Metadata Extractor
5 years ago by kometenstaub
Obsidian Plugin that provides metadata export for use with third-party apps.
Update time on edit
5 years ago by beaussan
Metadata Auto Classifier
2 years ago by Beomsu Koh
AI-powered Obsidian plugin that automatically classifies and generates metadata (tags, frontmatter) for your notes.
ExMemo Tools
a year ago by Yan.Xie
Use large models for smart document management and optimization, including relocating files, enhancing text, and generating metadata.
ExMemo Assistant
a year ago by ExMemo AI
Using LLMs to manage files and generating metadata such as tags and summaries.
KoReader Highlight Importer
a year ago by Tahsin Kocaman
Imports highlights and metadata from KoReader into Obsidian notes
Frontmatter Markdown Links
a year ago by mnaoumov
Obsidian Plugin that adds support for markdown links in frontmatter
Boardgame Search
a year ago by Marlon May
A plugin to create notes for boardgames based on the BGG API
Sentinel
a year ago by Giorgos Sarigiannidis
A plugin for Obsidian that allows you to update properties or run commands based on document visibility changes.
Current File Tags
a year ago by Trung Tran
Dataview Autocompletion
a year ago by Daniel Bauer
Clone Vault
a year ago by Sebastian Baroni
Clones the current Obsidian vault by copying settings and folder structure without note contents.
NetClip
a year ago by Elhary
this plugin is for Obsidian that allows you to browse the web and clip webpages directly into your vault.
Tag Tactician
a year ago by Scott Tomaszewski
Media Companion
a year ago by Nick de Bruin
Fold Properties By Default
a year ago by Tommy Bergeron
Always have editor/metadata properties folded by default.
FolderFile Splitter
a year ago by Xu Quan
LLM Tagger
a year ago by David Jayatillake
Paste Image Into Property
a year ago by Nito
My Thesaurus
a year ago by Mara-Li
A plugin that auto tags file based on contents and a csv file or a Markdown table (inspired by https://github.com/pmartinolli/MyThesaurus)
GridExplorer
a year ago by Devon22
Browse note files in a grid view.
Content Cards
a year ago by leo
Insert content cards in Markdown, such as timeline, highlightblock, target card, book information card, music information card, movie information card, photoes ablum, business card, content subfield, countdown, SWOT,BCG.
Manual Sorting
a year ago by Kh4f
📌 DnD file sorting for Obsidian
AI Tagger Universe
a year ago by Hu Nie
An intelligent Obsidian plugin that leverages AI to automatically analyze note content and suggest relevant tags, supporting both local and cloud-based LLM services.
Tier List
a year ago by Mox Alehin
Obsidian plugin for visual ranking and organizing content into customizable Tier Lists.
Note Favicon
a year ago by mdklab
Obsidian plugin – Show Favicon from Metadata
File Title Updater
a year ago by wenlzhang
An Obsidian plugin that synchronizes titles between filename, frontmatter, and first heading in your notes.
Auto Folder Note Paste
a year ago by d7sd6u
Convert your note into folder note upon pasting or drag'n'dropping an attachment
Kanban Status Updater
a year ago by Ankit Kapur
Obsidian plugin that automatically updates the note property when card is moved to a column.
Simple File Info
a year ago by Lukas Capkovic
Daily Notes Automater
a year ago by David Pedrero
Another Name
a year ago by Jiyuan Wang
Add a subheading to your note in Obsidian
GitHub Integration
a year ago by Kirill Zhuravlev
Plugin that fetch your github stars into notes
Note UID Generator
a year ago by Valentin Pelletier
Allow you to automatically generate UID for the notes in your vault.
Symbol linking
10 months ago by Evan Bonsignori ; Mara-Li
Adds ability to link with any trigger in Obsidian. Each trigger can limit linking to specific folders or file.
Frontmatter Metadata Link Classes
10 months ago by Varvara Zmeeva / zmeeva.io
Enhanced internal links with automatic classnames based on frontmatter metadata.
Discrete
9 months ago by shkarlsson
Sortable Tables
9 months ago by filippov112
A plugin for Obsidian that adds the ability to interactively sort Markdown tables in preview mode.
Papers
8 months ago by William Liang
An obsidian plugin to retrieve and import research papers.
Note Codes
8 months ago by Ezhik
Reference your Obsidian notes from anywhere with simple 4-character codes.
Pretty Properties
7 months ago by Anareaty
Book Clipper
5 months ago by Hossein Fardmohammadi
Save book details from websites into your notes
Conditional Properties
4 months ago by Diego Eis
Automate frontmatter property updates in your Obsidian notes using simple conditional rules.
Frontmatter to HTML Attributes
2 months ago by Tarek Saier
Makes YAML frontmatter available as data-* attributes in HTML, enabling metadata based CSS styling.
WebDAV Explorer
2 months ago by 蓝星晓夜
WebDAV Explorer: Connect to WebDAV server, preview files directly in web view, and generate links through simple drag-and-drop.
Kanban Bases View
2 months ago by I. Welch Canavan
A kanban-style drag-and-drop custom view for Bases.
Graphic Organizer
a month ago by Nick Le Guillou - Superhuman Curiosity
Interactive tree view for visualizing and managing your vault's file hierarchy.
Calendar Bases
a month ago by Edrick Leong
Adds a calendar layout to bases so you can display notes with dates in an interactive calendar view.
Lskypro Upload V2
a month ago by 3kk0
Auto upload local images to LskyPro.