How to control sort order of folders, and getting new notes in the right folder

What I’m trying to do

I recently wrote a converter that allowed me to move about 12 years of OmniOutliner personal notes into Obsidian. For those not familiar with it, OmniOutliner is a nice outline processor, so structurally, you’re building a tree. For the conversion, I mapped the tree (to a certain level) to folders in the obsidian vault. This worked out quite well. So well in fact that the day I got it working right, I moved immediately. There are just two behavioral issues that are problematic. This should probably be two separate posts but I don’t want the community to suffer reading the background twice.

  • The first issue is that sorting doesn’t seem to sort folders. All of my folders and actual note entries have a zettelkasten-style name beginning with a timestamp (because I move through reality on a timeline and it helps me to see events in chronological order, sorting on file name provides chronological sort). I prefer both the folder contents (notes) and the folders to be reverse-sorted (descending order) so that most-recent tasks and notes are always at the top. The sort function is sorting folder contents, but not the folders themselves, resulting in the most recent folders being at the bottom. Is there any way to get the folders sorted in descending order, or I’d even settle for manual manipulation if it were possible (but then Obsidian has to preserve that state).

  • The second issue has to do with location of new notes. There is a setting, “Default location for new notes” which I have set to “Same folder as current file.” If this worked for me, it would be great. There’s an advisory on this setting that says, “Plugin settings will override this.” I use the “Unique note creator” core plugin to create the zettelkasten date at the beginning of the note name. Unfortunately this plugin doesn’t have the same new note location option as does “Default location for new notes” setting. But because “Unique note creator is a plugin,” the “Default location for new notes” setting is ignored. From a design standpoint, this seems inconsistent given that we’re taking about a “core” plugin. If I want a zettelkasten date, I cannot put the note where I need it. If I choose to have the note where I need it, I can’t have a zettelkasten date. The features seem mutually exclusive. Is there any way around this, or do I have to request an “enhancement?” Right now it’s very cumbersome because when I create a note, the first thing I have to do is move it to the right location because it’s all the way at the bottom of the folder tree.

Things I have tried

I have tried playing with the settings but there aren’t a lot of options around these behaviors. Any help / guidance would be appreciated.

There is a community plugin that lets you change the sort order of folders and notes: GitHub - SebastianMC/obsidian-custom-sort: Take full control over the order and sorting of folders and notes in File Explorer in Obsidian

As a work around for moving your notes, have you tried the move file command? On desktop, it brings up a list of folders. You can set it to a keyboard shortcut so it’s entirely keyboard driven.

I do use the move file feature, but understand that I have a LOT of folders. So usually what I have to do is navigate the tree to where I want to be for the task at hand, and note the last 6 digits of the zettelkasten timestamp on the target folder. I then create the new note, and use Move File, search on those 6 digits, which manages to get the appropriate subfolder on the list. If “same folder as current file” worked, I would just navigate to where I need to be, tap the latest note, then create new, and the new note will become the top note on the list (sorted in descending order). So I think I’ll put in an enhancement request on this one because the behavior between the core plugin and the base system setting seem to interfere with each other. Thank you for the response.

The third party plugin Templater might help. There is a Templater command for renaming files. You would have to write a date string that is the Zettelkasten ID. I think the format string would be YYYYMMDDHHmmss.

Edit:
If you go with the Templater route, put this in your template file on a separate line.

<% tp.file.rename(tp.date.now("YYYYMMDDHHmmss")) %>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.