farux / obsidian-auto-note-mover

This is a plugin for Obsidian (https://obsidian.md).
MIT License
259 stars 22 forks source link

Feature Request: Run Auto-Move Check on All Notes #20

Open shinyben opened 2 years ago

shinyben commented 2 years ago

I have a massive amount of notes that I would like to sort into files. I would prefer to not have to edit each one (by adding a space at the bottom) to run the check but rather be able to run a command to check all of my notes and move them if appropriate.

farux commented 2 years ago

Hello. Currently the entire vault is checked when the reindexing occurs.(e.g. with a major update)

A solution for the time being.

  1. Create a new folder in the root of the vault.
  2. Move all files and folders in the vault whose name prefix is not a period to the folder created in step 1.
  3. Move the notes and folders moved in step 2 back to their original location.

This will trigger the note rename event and ANM will check them.

grangej commented 1 year ago

This doesn't seem to work , is there another way to force this?

moutons commented 1 year ago

It'd be nice if the Auto Note Mover: Move the note command could be triggered on multiple selected notes instead of just within a note's body

lsilvam commented 1 year ago

A scheduled sweep at a given time or when the app closes would be excellent options.

swiftysix commented 1 month ago

So I found a hack if you have the following problem: You have used nested tags for organization and have all notes in a single file. Now you want to separate the files into individual folders. So you want to map tags to folders e.g. sw-dev/javascript should go to a folder sw-dev/javascript. You also want the freedom to map the tags security/ssl, security/threat-modelling etc. to one single folder "security".

This is possible via a workaround using this plugin (Auto Note Mover) and "Tag Wrangler" in combination.

So for the simplest case (mapping 1:1) you do this:

  1. Create the destination folder manually
  2. Setup the following Auto Note Mover rule: "folder name" --- "#tag/to/map1" Note the "1" index at the end of the tag. You have to add an arbitrary number or character at the end of your tag for this to work
  3. Rename the tag using Tag Wrangler: rename from #tag/to/map to #tag/to/map1 Now Auto Note Mover will detect a change and will move the files to the new folder
  4. Rename the tag #tag/to/map1 back to #tag/to/map

Now for the more complex case you can do the same essentially but it also allows you to flatten hierarchy and e.g. catch all files of a parent tag if you're using nested tags. E.g. you want to move all files of security/ssl, security/tls, security/threat modelling, etc. to a single folder "security":

  1. Create the destination folder manually
  2. Activate regex matching in Auto Note Mover plugin for tags
  3. Setup the following Auto Note Mover rule: "folder name" --- "^#security1.*" (note: without the ") Note the "1" index at the end of the tag. You have to add an arbitrary number or string at the end of your tag for this to work
  4. Rename the parent tag using Tag Wrangler. For this go to the global tags view in Obsidian and rename the parent tag there directly. So rename "security" to "security1" Now Auto Note Mover will detect a change and will move the files to the new folder.
  5. Rename the parent tag in Obsidian global tag view back from "security1" to "security"

This worked for me when reorganizing my notes.