Giter VIP home page Giter VIP logo

obsidian-file-order's Introduction

File Order Obsidian Plugin

Use number-prefixes in your file names to define a custom order, and use drag-and-drop in the file explorer to update that order.

  • Find the Plugin "File Order" in the community plugin list in obsidian to install.

To use, after installation you can right-click on any folder or item and click on "Reorder items" to open the reorder dialog. There, you can drag and drop items to customize their order. By clicking in the down-arrow next to the "Files" or "Folders" title, you can access additional options. There you can customize a minimum prefix length (e.g. have all prefix numbers be at least 3 characters long), customize the delimiter (a single space by default, but can be anything) or the starting index.

Reordering items will automatically update all references to any files you are reordering.

You can also always clear a custom ordering you made in the past, which will remove the prefixes from the file names and restore the default ordering.

When you open the reorder dialog another time in the future on a folder, which you have customized before, the plugin will automatically infer these options from the set file names. This means that the plugin maintains no settings itself, every ordering information used is stored in the file names themselves, meaning you can continue to use the ordered files even after you uninstall the plugin, and the plugin will also be able to read and allow you to edit orderings you have created manually in the past.

In the plugin settings, you can also define default values for prefix length, delimiter and starting index.

obsidian-order-files-demo1.gif

obsidian-order-files-demo2.gif

Screenshots

img.png

img_1.png

img_2.png

Contributing

To make changes to this plugin, first ensure you have the dependencies installed.

yarn

Development

To start building the plugin with what mode enabled run the following command:

yarn dev

Note: If you haven't already installed the hot-reload-plugin you'll be prompted to. You need to enable that plugin in your obsidian vault before hot-reloading will start. You might need to refresh your plugin list for it to show up.

Releasing

Run yarn release to release a new version.


This plugin was generated by (create-obsidian-plugin)[https://www.npmjs.com/package/create-obsidian-plugin]

obsidian-file-order's People

Contributors

bcardiff avatar lukasbach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

bcardiff

obsidian-file-order's Issues

support a,b,c ABC as prefixes

My file name encoding is like this
3a, 3b, 3c
Or
A1, a2, a3
Supporting mixed arrangement of numbers and letters is a great feature

Support multilevel numbering

Is your feature request related to a problem? Please describe.
My files look like the following:

image

You can tell how much of a headache it would be to manually change the ordering. Currently I use a CLI helper to rename my files, but it would be nice to be able to manage things from inside Obsidian.

Describe the solution you'd like
Add option for nesting prefixes, allowing for a custom separator in case the user wants something like 1-2-1 title.

Describe alternatives you've considered
None

Additional context

Compatibility with Folder Notes

Using the folder notes plugin together with the File Order plugin produces unwanted results. This is a shame because together they could be a very powerful combination.

When the folder notes plugin is active, a note within a folder is associated with the folder as a folder note. It is hidden from the file explorer list of notes within that folder but appears when the user clicks on the folder name.

When the user selects 'Reorder items' using file order plugin, the folder note is listed alongside other notes within a folder. It is not possible to exclude this note from reordering and so whenever the order of files is changed, the name of the folder note (and therefore the folder) is also changed, with a prefix appearing, and because the folder note appears at a higher level due to the operation of the folder notes plugin, this means the order of the remaining notes may be incorrect. Unfortunately, this makes the two plugins essentially incompatible with each other.

To resolve this issue, either:

(a) the folder note needs to be detected and excluded from the list of notes presented to the user and ignored, or
(b) the user needs to be able to select one (or more) of the listed notes and exclude it from the file ordering process.

The first of these two would be smoother for the user but the second is more flexible - it would have other benefits for non-file order users and possibly be easier to code.

[FR] exclude certain files

Im using Make.md plugin that creates sqlite files like "context.mdb" in every folder, which help me have like board view of my folder files.
I need those files to remain the current name, but this plugin will rename all the files at once.
can this plugin add a function that allow users to exclude certain files?

Sort files and folders together

Can you directly generate a local file form after the list of drag-and-drop, and then implement the file and folder sorting together?

Unable to reorder 1st-level folders

Unable to reorder folders when right-clicking on 1st-level folders.
image

Only able to reorder 1st-level folders when right-clicking on 1st-level files.
image

If I do not have any 1st level .md files, ie. all my files are within folders, there would be no way to reorder the folders in the first level. Right now I just keep an empty file in the first level and reorder the rest of my folders by right-clicking that file. It works but took a while to figure out this work around.

Ignore a directory

I have Obsidian configured to save media files under an assets directory, that is relative to the directory where notes are stored. That means I can have many assets directories at many multiple levels, depending on whether or not I have media files on notes.

How can I configure the plugin to ignore all assets directories, regardless of where they are? Thanks!

Support for top level folders

@lukasbach,

Maybe it's my missing but I tried for a while but still can not find a way to sort the folders at top level.
I've also tried to enable the "show root folder" in the file tree alternative plugin, but the right-click-menu of
top level folder only has a "create new folder" feature.

It's seems that the file-order plugin need a button to popup the file sort on top folder?

Thank you for contribution,
Best regards,
Houcheng

Use frontmatter to store page number.

Thank you for a nice plugin !:)

Would it be possible to store page numbers not as a prefix to page name like '01 my note', but in a frontmatter of a note and folder note like:

---
Pages: 1
---

This way it can be used together with plugin https://github.com/SebastianMC/obsidian-custom-sort.

If this can be implemented and you are interested, I can provide you with a detailed specification of the solution.

Thank you in advance.

Add option to change context menu "reorder"'s executing folder target

Hi, thanks for such a nice plugin.
Right now, when right click on a, say, folder in the explorer, and click on the "reorder items" menu, it means reordering items within the current folder.
But I feel adding an option to allow the items being reordered are the ones that is siblings to this folder within the same parent folder is no less important and convenient. Especially when there are many folders within its parent folder, right clicking on the inner folder causing reordering to take place right on itself makes more sense.
I reckon the modification wouldn't be too hard, just changing some path to its parent folder path might work.
Thanks!

Two File Name should be same for different file types

For Example,
I have a video & its subtitle file then if I want the video file to be played with subtitles then File name should be same.

  1. Amazon Comprehend 101.mp4

  2. Amazon Comprehend 101.vtt
    Not

  3. Amazon Comprehend 101.mp4

  4. Amazon Comprehend 101.vtt

Ignore folder notes

Obsidian Folder Notes

Hi. I use obsidian-folder-notes plugin which allows you to create a note for each folder inside it.

For example, if I have a folder named programming, obsidian-folder-notes can create a note named programming.md inside the programming folder. Note that the name of the note is exactly as the same as the name of the folder (plus .md extension). You can use it this note for many purposes. Let's call these notes "folder notes". A "folder notes" is hidden and can be access by clicking at the folder itself.

I found this plugin useful and I use it. For example, imagine you have some folders inside the programming folder, named Java and Python. You can list and link programming "folder note" to Java and Python "folder notes".

What is the feature that I'm requesting?

I think it would be wonderful if there was an option that by using it, obsidian-file-order plugin ignores all the folder notes.

Questions

Is your feature request related to a problem? Please describe.
No. What I'm explaining is not related to a problem.

Describe the solution you'd like
An option that we can set it in obsidian-file-order plugin to ingore "folder notes."

Describe alternatives you've considered
Unfortunately, I don't know how to write RegEx. I described my desire to ChatGPT, and copied and pasted the RegEx it provided inside the "ignore pattern". But it didn't work. If my request can be done by just using correct RegEx, I would be thankful if someone can help me to write a proper RegEx. The RegEx-s that ChatGPT created for me were:
"^([^\/]+)/\1.txt$"
"^([^/]+)\1.txt$"

Additional context
I don't have any more context to share. But if anymore information is needed, please let me know.

Global order operation

Make it a global on/off feature.

Many people may prefer to order their files and folders alphabetically as a matter of course, not on a folder-specific basis, and may not want to use a sort sync file.

Hide prefixes

Great job.

Would it be possible to add an option to hide the prefixes so to keep the interface tidy?

Thanks!

Making it function on a mobile device

Is your feature request related to a problem? Please describe.
I would like to activate the plugin and use it to reorder files in my android phone.

Describe the solution you'd like
Enabling the plugin for mobile devices.

Describe alternatives you've considered
No alternatives already attempted.

?Not functional on iOS

Is your feature request related to a problem? Please describe.
Works great on 2 Macs, but on iPhone, iPad, file numbers are out of order

Describe the solution you'd like
Enable working with iOS/iPadOS

Describe alternatives you've considered
None

Additional context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.