How to apply different sortspec to folders and notes? #100
-
Apologies for the dumb question. I want my subfolders to be sorted alphabetically, but all notes to be sorted by creation date. is this possible without specifically naming the subfolders in the yaml? I often change my subfolder structure, so it would be nice if I didn't have to specify the note sorting rule manually. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
if I get your question correctly, you need the below sorting specification: ---
sorting-spec: |
target-folder: /
/folders ...
< a-z
/:files ...
> created
--- You read it as:
Indentation matters - the two order specifications have to be indented at least one space more than the surrounding lines At the same time: do I get your question correctly? Because the exact result is produced by the Obsidian standard UI-selectable sorting 'Created time (new to old)'. Obsidian always puts folders first, in alphabetical order, regardless of what sorting order you select in UI. And the selected order is applied only to files (aka notes). The obvious advantage of the custom sort plugin is that you can define a different sorting order per each folder. And that could be one of reasons not to stay (only) with the built-in UI-selectable sorting. |
Beta Was this translation helpful? Give feedback.
-
Thank you so much! It was probably a stupid question. In any case, that solves it. Thanks! |
Beta Was this translation helpful? Give feedback.
Hi @pinetreemoonlight,
if I get your question correctly, you need the below sorting specification:
You read it as:
target-folder: /
)/folders ...
)< a-z
order specification)/:files ...
)> created
)Indentation matters - the two order specifications have to be indented at least one space more than the surrounding lines
At the same time: do I get your question correctly? Because the exact…