README file from
GithubObsidian Text Mover
This is a plugin for Obsidian (https://obsidian.md) that lets you move text from one place to another place. Pretty simple stuff.
Features
- Move text to another heading in the current note.
- Move text to another note.
- Move text to a daily note, either by choosing a date or by sending it to the next day's note.
- Create custom commands for frequently used destinations, such as a specific note or tomorrow's daily note. Custom commands can target a heading and insert before or after its contents.
- Optionally choose whether text is appended to or prepended within a heading.
Text Mover uses Obsidian's built-in Daily Notes settings for the date format, folder, and template. The Daily Notes core plugin must be enabled to use daily-note commands.
How to use
- Open a note and select the text you want to move. If nothing is selected, Text Mover uses the current line. Multiple selections are not supported.
- Open the command palette and search for a Text Mover command:
- Move text within current document — choose a different heading in the current note.
- Move text to another document — choose a note. If it has headings, choose a destination heading; otherwise, the text is added at the end of the note.
- Move text to daily note — choose a date, with suggestions for today, tomorrow, and the coming days. You can also type a day of the month, optionally followed by a month name.
- Move text to next daily note — send the text to tomorrow's daily note.
- Any custom commands you have created.
- For heading destinations, choose the matching heading. By default, text is appended to its section. To choose between inserting at the beginning or end, enable Append and prepend in the plugin settings.
When a daily note does not exist yet, Text Mover creates it using the folder, date format, and template configured in Obsidian's Daily Notes settings. If the destination note has headings, you can choose a heading; otherwise, the text is added to the note.
Create a custom command
- Open Settings → Community plugins → Text Mover.
- Under custom commands, select Add.
- Give the command a unique name, then choose a specific file or tomorrow's daily note.
- For a specific file, select an optional heading. Choose whether the text should be appended or prepended, then submit.
The new command will appear in the command palette. You can remove it from the same settings page.
Install manually
Download main.js and manifest.json from a release and place them in your
vault at:
<Vault>/.obsidian/plugins/text-mover/
Restart or reload Obsidian, then enable Text Mover under Settings → Community plugins. For local development, build the plugin as described below and copy the generated files into this folder.
Contributing
Contributions, bug reports, and feature suggestions are welcome. For code changes:
-
Fork the repository and create a branch for your change.
-
Install dependencies with
npm install(Node.js 18 or newer is recommended). -
Make your changes in
src/. Runnpm run devto rebuildmain.jsautomatically while developing. -
Run the checks before opening a pull request:
npm test npm run lint npm run build -
Test the behavior in Obsidian where practical, then open a pull request describing the change and any relevant testing.
main.js is generated by the build and should not be committed. Keep changes
focused, and add or update tests when changing behavior.
Development commands
| Command | Description |
|---|---|
npm install |
Install development dependencies. |
npm run dev |
Build in watch mode for development. |
npm run build |
Type-check and create a production build. |
npm test |
Run the test suite once. |
npm run test:watch |
Run tests in watch mode. |
npm run lint |
Lint the project. |
Releasing
- Update the version in
manifest.jsonand the minimum supported Obsidian version if needed. - Add the matching version-to-minimum-app-version entry to
versions.json. - Run
npm run build. - Create a GitHub release with a tag exactly matching the version in
manifest.json(without avprefix), and attachmanifest.jsonand the generatedmain.js.
The npm version patch, npm version minor, or npm version major commands
can be used to bump the version; this repository's version script updates the
manifest and versions.json.