|
|
||
|---|---|---|
| Models | ||
| Settings | ||
| Utils | ||
| .editorconfig | ||
| .eslintignore | ||
| .eslintrc | ||
| .gitignore | ||
| .npmrc | ||
| biome.json | ||
| bun.lockb | ||
| esbuild.config.mjs | ||
| ItemToMove.md | ||
| LICENSE | ||
| main.ts | ||
| manifest.json | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| styles.css | ||
| tsconfig.json | ||
| version-bump.mjs | ||
| versions.json | ||
AutoMover plugin
This plugin is used for designating folders in which your files will be moved automatically. It seeks to be an alternative to the "https://github.com/farux/obsidian-auto-note-mover" plugin from farux. The problem I had with that plugin was the lack of support for regex and regex groups in the destination paths.
Therefore, this plugin supports regex and regex groups to create the destination paths unless they already exist.
How to use
Using the plugin doens't require any special setup. Just install it and you're good to go. Also, you can use it without knowing what regex is, but it's recommended to learn it to get the most out of this plugin.
Introduction to the UI
This image shows the UI of the plugin with numbers attached to each part of the UI. The numbers are elaborate below the image.
- Plugin location: This is where you can access the plugin's settings.
- On-open toggle button: This button toggles whether the plugin will run when you open a file.
- Manual run button: This button will run the mover manually for all the files in the obsidian vault.
- Quick Tutorial: This is a quick tutorial and reminder on how to use the plugin.
- Search criteria: This is where you can input strings or regex that will be used to match the files you want to move.
- Destination path: This is where you can input the destination path for the files that match the search criteria.
- Add rule button: This button will add a rule to the list of rules.
- Delete rule button: This button will delete the selected rule from the list of rules.
- Duplicate rule button: This button will duplicate the selected rule from the list of rules.
Example without regex
Important note 1: The text is case sensitive.
Important note 2: Use the "/" character to separate folders.
Lets imagine you have three files called Scroll 1, Scroll 2 and Scroll 3. Such as you can see below:
After you install the plugin, you can create a rule to move all files that start with "Scroll" to the "Scrolls" folder. The rule would look like this:
This will then create a folder called "Scrolls" and move all files that start with "Scroll" to that folder. The end result will look like this:
Example with the usage of regex and groups
Important note: The regex flavor used in this plugin is the ECMAScript(Javascript) flavor. The biggest difference between ECMAScript and PCRE2 is that {} brackets require the first value to be something ({0,1} -> zero or one of), while in PCRE2 it can be empty ({,1} -> zero or one of).
Imagine that you wanted to sort each scroll by its number into a separate folder. You could use the following regex to achieve that:
This will then create a folder for each scroll number and move the respective files to the correct folder. The end result will look like this:
Writing Regex: The best tool for writing regex is Regex101 (https://regex101.com/)
Requesting features and reporting issues
If you want to request a feature or report an issue, please do so by creating an issue in the issues tab of this repository. In case you for some reason want to contact me directly, you can do so by sending me an email which is displayed in my github profile or via LinkedIn which is also displayed in my github profile.
Contribution
If you want to contribute to this plugin, you can do so by forking this repository and creating a pull request with your changes and an elaboration what they are and why. Thank you!