File Explorer Custom Sort

You are not even wrong. Being able to order notes has little if anything to do with data portability of the underlying document format nor does it have much to with ‘trusting’ a plugin. It has everything to do with plugins frequently breaking in a rapidly developing Obsidian ecosystem and thus they must be regularly maintained – and likely will not be maintained – if a developer decides to move on.

Finally, order and structure – whether it be an outline, pages within a report, chapters, or any simple sort of hierarchy within a dataset, program, or document – is what turns data into knowledge. Ultimately Obsidian is, or should be, about capturing knowledge. If not, I can just dump files into a directory, a capability already offered by the file system.

Yes, you can add a custom sort feature to your file explorer. Implement drag-and-drop functionality for file reordering, and provide a toggle to switch between custom sort and standard sorting options like name, date, and size.

I don’t mean to rant, but I am finding the lack of ability to manually sort notes extremely frustrating.

Obsidian is, supposedly, about building one’s knowledge base. A big part of that process is the intermediate steps of sorting ones notes, files, and folders. I mean this not only in the literal sense of paper notes and folders, but also Obsidian’s notes and folders. Once the organization of the knowledge reaches some intermediate form, one can, say, construct a table of contents in a markdown file to crystalize the knowledge. The TOC or outline is often far superior to sorting. But the intermediate process of getting to that point is necessarily messy. Not being able to sort notes and folders along the way make it very difficult to create knowledge from raw data. The connected graph tree view has some uses, but ultimately is too limited of a way to structure a knowledge system. Sorting adds additional and frequently needed value.

I’ve been a paying member of Obsidian, but I am considering leaving because of the lack of manual sorting. It seems bizarre to me that it doesn’t have a basic feature baked into most other knowledge systems (OneNote, Notion, Scrivener) and even basic file explorers (Directory Opus). The lack of interest in this feature and below-the-surface antipathy towards it is leading me to conclude this is just not the right platform and never will be.

3 Likes

That’s it, I’m finished. Yesterday I fired up Scrivener for a project I’m starting and within two hours I got more done than I did in several days of messing around with Obsidian. I can say the same thing about OneNote, which has become more powerful with the OneMark markdown and Onetastic addons.

It’s too bad really. I see an enormous amount of potential with Obsidian that other offerings lack. There’s no easy way to integrate PDFs and other files types in OneNote for instance. The linking of notes is so much better and extremely powerful. I love the fact the data can be saved in portable Markdown documents and how it connects well with the underlying file system. CSS styling is very powerful as well. It’s great stuff. But the inability to to sort notes is absolutely crippling once one gets beyond a couple of hundred notes and folders. I am constantly having to artificially rename things with underscore or number prefixes. It’s a mess and too much mental overhead is given over to keeping things straight. I must approach knowledge in a more structured way than those who depend on links and a graph view, the latter of which, honestly, seems little more than a visual marketing gimmick than it does as a serious method to organize and explore information.

I’ll play around with Obsidian occasionally to see how it develops. As I said, I’m a fan and see the potential. But I’ve cancelled my subscription in the meanwhile and won’t join back up until Obsidian offers the ability to sort notes like nearly every other purported ‘second brain’ system does.

2 Likes

I really like the way Azure DevOps wiki manages custom sort in a lightweight, text only way:

  • By default the files are sorted alpha-numerical (however the folder sort is defined)
  • If a file is dragged then a .order file is created. Its just a simple text file listing the topic names in the order to display for that folder.
  • If any file is missing from the .order file then it is displayed at the end according to the folder sort.
  • If you delete the .order file then it goes back to the default sort.

No need for xml, yaml, json,

2 Likes

I looked at he Azure DevOps wiki and this seems like an interesting approach. It could even address the use case in Obsidian where a user drops a file in a directory outside of Obsidian. In this case, just put the file at the end of the manual sorting. This is essentially what OneNote does when a new page is shared to a section from a 3rd party application.

Any updates?

That’s a lot of posts I’ve scrolled through. Is anyone using a simple plugin that doesn’t change everything including the kitchen sink, but JUST lists subfolders AFTER files in a folder?

It seems like a small thing rather than the whole alphabetical/created/modified sorting thing.

There isn’t a simple one, unfortunately.

Do you want all subfolders after all files, or folders mixed with files as in Finder on Mac?

If the latter, there is the Custom File Explorer Sorting plugin, but it requires you to wade thru a bunch of documentation and write/paste the setting in a special file. I’ll dig my copy out so you can skip the docs-wading. (Most of it i— all the lines that start with `//‘ — is just informative comments.)

---
sorting-spec: |-
  //
  // A simple configuration for obsidian-custom-sort plugin
  // (https://github.com/SebastianMC/obsidian-custom-sort)
  // It causes the plugin to take over the control of the order of items in the root folder ('/') of the vault
  // It explicitly sets the sorting to descending ('>') alphabetical ('a-z')
  // Folders and files are treated equally by the plugin (by default) so expect them intermixed
  // in the root vault folder after enabling the custom sort plugin
  // 
  // To play with more examples go to https://github.com/SebastianMC/obsidian-custom-sort#readme

  target-folder: /*
  < a-z
---

The plugin may be able to handle the former case too, but you’ll have to read the docs for that.

2 Likes

I agree that this needs to be an option for power users. The plugin is cool – and I appreciate the effort – but it feels hacky and workaround-y. Not what obsidian should be going for; it should be a core plugin instead, built into the native file structure but off by default.

2 Likes

I’m the author of the mentioned Custom File Explorer Sorting plugin.

To impose the requested sorting using the plugin you need to employ the below sorting specification (indentation matters):

---
sorting-spec: |-
  target-folder: /*
  /:files
  /folders
  sorting: ui selected
---

For convenience attaching the sortspec.md file, which you can download and put in any convenient location in your vault: sortspec.md (89 Bytes)

The sorting specification, if you read the spec, says:

  • apply the following sorting logic to all folders in the vault ( target-folder: /*)
  • files go first ( /:files)
  • then go subfolders ( /folders)
  • the order to apply within the groups should be the one selected in Obsidian UI ( sorting: ui selected)

After applying the above sorting specification, files in each folder will be grouped first, and sorted as selected in UI dropdown, the subfolders will follow also sorted according to UI dropdown selection.

The above sorting specification is a good starting point to further fine-tuning the ordering. For example apply different orders for files and different for subfolders. Or apply the specified sorting logic selectively for some of folders in your vault, etc.

2 Likes

Now that properties exist it seems natural that the sort order could also be based on properties like for example “date”. I also hope this could be implemented in a plugin or a core plugin

It already is. Obsidian Custom Sort by SebastianMC right above your reply: obsidian-custom-sort/docs/advanced-README.md at master · SebastianMC/obsidian-custom-sort · GitHub

“group and sort notes and folders by notes custom metadata”

A concern I have about leaving sorting to a community plugin, is what might happen in the future if this or another sorting plugin might break? This is a different matter than just losing functionality. The sort order will often be a vital part of the knowledge itself. That is, this is a question of data loss, something that is more serious.

So I spent twenty-five minutes watching this YouTube video that reviews the Obsidian Custom Sort plugin by SebastianMC

While I very much appreciate the developer’s efforts to implement the described functionality, this is a very painful way to do something that is a dead simple drag and drop operation in other knowledge systems.

I want to reiterate the importance of sorting: It is not an easy task to create knowledge from raw data. It’s a back and forth, iterative process that requires concentration and focus to turn ideas into concepts. There are many dead ends and restarts along the way. If one is burdened by the extra weight of having to futz with a metadata .md just to reorder a file, the task goes from difficult to impossible.

There are reasons why the ability to easily drag and drop and sort files keeps coming up. It’s neither a cosmetic nor a cool, ease-of-use feature. Just as with physical folders and pieces of paper, it’s central to the process that many people, especially creatives, do when they bring into existence something novel.

1 Like

It is absolutely, utterly, and completely insane that in the year 2024, the most highly recommended note-keeping app does not even have the capability of sorting notes in whatever order you want.

This is baby’s first functionality. This is literally the thing people want most, because it gives them control of their capacity to sort. There is zero excuse why it should not be considered to be the most standard, most basic feature next to ‘saving notes’ in a note-taking app. If you have notes in a FILE TREE on the side, with FOLDERS, you should have the capacity to sort them. Full stop. It is breathtakingly infuriating to not have such a simple piece of functionality – I cannot even call it a FEATURE – baked in.

2 Likes

I personally don’t support this. It brings core obsidian away from its file first approach by implementing a custom sort that won’t apply in another app or the OS file explorer. Its the exact sort of functionality that should be in a community plugin! Besides the fact that we already have portable, file-first custom indexing with index prefixing and sort by alphanumerical order (e.g. 00_Note.md). Custom sort with some sort of magic index file behind the scenes is imo, a step backwards in functionality compared to index prefixing, which works reliably and doesn’t require any extra code paths. This doesn’t seem the right direction to bring the core of obsidian in.

I don’t see how this sort is seen as a minimum requirement. Finder and Windows Explorer don’t have custom arbitrary sort. In fact I struggle to think of a file explorer that isn’t heavily abstracted from the underlying file system that does that at all. Sort by kind (file vs folder vs specific file type) would be the only aspect of this FR that I think makes sense.