Text Mover

by tallvincent
5
4
3
2
1
Score: 37/100

Description

Reviews

No reviews yet.

Stats

0
stars
27
downloads
0
forks
7
days
5
days
7
days
1
total PRs
0
open PRs
0
closed PRs
1
merged PRs
3
total issues
2
open issues
1
closed issues
55
commits

Latest Version

8 days ago

Changelog

Initial release.

README file from

Github

Obsidian 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

  1. 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.
  2. 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.
  3. 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

  1. Open Settings → Community plugins → Text Mover.
  2. Under custom commands, select Add.
  3. Give the command a unique name, then choose a specific file or tomorrow's daily note.
  4. 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:

  1. Fork the repository and create a branch for your change.

  2. Install dependencies with npm install (Node.js 18 or newer is recommended).

  3. Make your changes in src/. Run npm run dev to rebuild main.js automatically while developing.

  4. Run the checks before opening a pull request:

    npm test
    npm run lint
    npm run build
    
  5. 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

  1. Update the version in manifest.json and the minimum supported Obsidian version if needed.
  2. Add the matching version-to-minimum-app-version entry to versions.json.
  3. Run npm run build.
  4. Create a GitHub release with a tag exactly matching the version in manifest.json (without a v prefix), and attach manifest.json and the generated main.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.