Advanced Note Composer

by mnaoumov
5
4
3
2
1
Score: 54/100

Description

The Advanced Note Composer plugin extends the functionality of Obsidian's core Note Composer plugin by addressing common limitations during note merging and content extraction. It intelligently updates relative links when content is moved between files, preventing broken links that usually require manual fixing. Additionally, it handles invalid characters in titles by either sanitizing them or storing the original form in note aliases or frontmatter titles for better compatibility with quick switcher and metadata-based workflows. This plugin is especially useful for users who regularly restructure their notes and want a smoother, error-free experience.

Reviews

No reviews yet.

Stats

20
stars
7,422
downloads
0
forks
444
days
0
days
0
days
3
total PRs
0
open PRs
1
closed PRs
2
merged PRs
136
total issues
18
open issues
118
closed issues
0
commits

Latest Version

README file from

Github

Advanced Note Composer

Buy Me a Coffee GitHub release GitHub downloads Coverage: 100%

This Obsidian plugin extends the core Note composer plugin fixing some bugs and adding additional features.

If you use Merge current file with another file..., Extract current selection..., Extract this heading... from the note with relative links, the core plugin moves those links as is, which leads to broken links you have to fix manually.

The current plugin adjusts such links and makes them valid.

Invalid titles

Sometimes when you extract selection or heading, the chosen title is invalid

# Title with invalid characters *\<>:|?#^[]"

The core plugin will show an error when you try to extract such heading.

The current plugin allows to replace/remove such invalid characters.

If those invalid characters were used intentionally, the plugin allows to add the invalid title

  • to the note alias (to be able to access it from the Quick switcher).
  • to the frontmatter title key.

Treat title as path

Treat title as path option converts titles that contain / into paths.

For example, when we invoke Extract this heading... command for ## a / b / c / d:

If Treat title as path option is

  • enabled - the split file will be a/b/c/d.md. Leading and trailing spaces are trimmed.
  • disabled - the split file will be a _ b _ c _ d.md. Spaces are preserved. / is replaced with _ (or another replacement string as per settings).

Move selection to another note (smart cut & paste)

The core Extract current selection... command moves a selection into another note in one step, always appending/prepending it to that note. This plugin adds a decoupled, two-step move that lets you drop the selection at an exact cursor position in any note (including the same note), while still running the full extraction workflow (relative-link fixing, footnotes, frontmatter, templating).

Commands (each appears as Smart cut & paste: … in the command palette):

  • Mark selection to move — available when there is a selection. Records the selection and its note, and locks that note (blocking edits) so the marked region cannot drift before you move it. The note stays unchanged — nothing is removed yet. Enable Should lock all notes when marking selection to lock every note (not just the source) while a mark is held, so you must finish the extraction before editing anything.
  • Move marked selection here — available once something is marked. Moves the marked selection to the cursor in the current note, using your default settings, as a single reversible operation. If you have text selected in the target when you run it, the moved text replaces that selection (like pasting over a selection); with no selection, it is inserted at the cursor.
  • Move marked selection here (advanced)... — same, but first prompts for the frontmatter merge strategy, whether to fix footnotes / include frontmatter, and the text to leave in place of the moved text (see Text after extraction below).
  • Move marked selection to top of file / Move marked selection to bottom of file — available once something is marked. Move the marked selection to the top (just after any frontmatter) or bottom of the current note, regardless of the cursor position. These ship with no default hotkeys — bind your own in Obsidian's Hotkeys settings (for example Shift+Enter / Enter) for quick keyboard extraction.
  • Cancel move — available once something is marked. Discards the mark and unlocks the note(s) without moving anything. The built-in Unlock active note command (available on any locked note), or right-clicking a note's lock indicator, cancels the whole pending move the same way.

While a selection is marked, a persistent Smart cut & paste notice reminds you that a move is pending until you complete or cancel it. The notice carries buttons — Move marked selection to top of file, Move marked selection to bottom of file, Move marked selection at cursor, and Cancel move — each enabled only while it applies to the active note, so you can drive the whole move from the notice without opening the command palette.

The Smart cut & paste settings group lets you tailor this notice:

  • Should show smart cut & paste notice — turn the whole notice off if you prefer to drive marking, moving, and cancelling purely through the commands (and their hotkeys). Nothing is shown when a selection is marked.
  • Should show move to top of file button / Should show move to bottom of file button / Should show move at cursor button — hide any of the three move buttons you do not use, leaving a tidier notice. Cancel move is always shown. Hiding a button never unregisters its command, so any hotkey you assigned to it keeps working.
  • Smart cut & paste template — the template applied to the pasted text when you move a marked selection via smart cut & paste (Move marked selection here, at cursor, to top of file, or to bottom of file), so a smart-cut paste can be formatted differently from an ordinary split into a new note. Supports the same tokens as the other templates ({{content}}, {{fromTitle}}, {{fromPath}}, {{newTitle}}, {{newPath}}, {{date:FORMAT}}). Leave it empty to reuse the Split template (which itself falls back to the Merge template), preserving the previous behavior.

The captured selection is also persistently highlighted in the source note so you always see exactly what will be moved. This applies both while a smart-cut selection is marked and while an Extract … / split picker is open (the selection stays highlighted while you choose the target). The highlight clears when the operation completes or is cancelled.

Notes:

  • Switch to smart cut from the split picker. Because splitting and smart cut share the same setup, the Extract … picker shows a Switch to smart cut & paste button (or press Alt+S) that switches to smart cut & paste instead of splitting: the picker closes, your selection is marked to move, and the note highlighted in the picker opens so you can position the cursor and paste. The same Switch to smart cut & paste button also appears on the split confirmation dialog (when Ask before splitting is on), so you can switch after the target is chosen.

  • Change target from a confirmation dialog. Every confirmation dialog that follows a target picker shows a Change target button (or press Alt+C) that sends you back to the picker to pick a different target — without cancelling and re-triggering the whole operation. This applies to the split confirmation dialog (when Ask before splitting is on) and to the merge-file and merge-folder confirmation dialogs (when Ask before merging is on). For the split and merge-file pickers, the reopened picker is preselected with your previous choice.

  • Switch to split/extract from the notice. The reverse switch: the Switch to split/extract button on the Smart cut & paste notice (or the Smart cut & paste: Switch to split/extract command) re-opens the source note with the selection restored and opens the split/extract picker, so you can search for a target and split into it with the full option set.

  • The move only removes the text from the source note when you run the paste, so footnotes, links, and frontmatter are still resolved from the intact source.

  • When the target is the same note as the source, Move marked selection here is unavailable while the cursor is inside the marked selection (and the top/bottom commands are unavailable when the top would land inside a selection that spans the note's frontmatter).

  • Same-note extraction from the picker. The Extract current selection... / Extract this heading... pickers now also offer the current note as a target, so you can extract a selection to the top or bottom of the same note: press Enter (bottom) or Shift+Enter (top) on the current note in the picker.

  • Same-note moves and Text after extraction. The Text after extraction setting decides what is left in place of the extracted text (a link to the target note, an embed, or nothing). When you move within the same note, a link/embed pointing at the note itself is meaningless, so by default the moved text is simply removed. Enable Apply text after extraction to the same file to apply the setting to same-note moves anyway, or override it per move in the advanced command.

Minimizing dialogs

Every picker and confirmation dialog this plugin opens — the Merge …, Extract … (split), and Swap … pickers and their confirmation dialogs — can be minimized to a small floating bar so you can peek at the notes involved without dismissing the dialog. The bar has two buttons:

  • Restore — reopens the dialog where you left off.
  • Cancel — closes the dialog. For an operation that locks its note while the dialog is open (an extract/split or a merge), cancelling this way also unlocks the note and cancels the operation — the same effect as the built-in Unlock active note command or right-clicking the note's lock indicator, but reachable directly from the minimized bar.

Installation

The plugin is available in the official Community Plugins repository.

Beta versions

To install the latest beta release of this plugin (regardless if it is available in the official Community Plugins repository or not), follow these steps:

  1. Ensure you have the BRAT plugin installed and enabled.
  2. Click Install via BRAT.
  3. An Obsidian pop-up window should appear. In the window, click the Add plugin button once and wait a few seconds for the plugin to install.

Debugging

By default, debug messages for this plugin are hidden.

To show them, run the following command:

window.DEBUG.enable('advanced-note-composer');

For more details, refer to the documentation.

Support

My other Obsidian resources

See my other Obsidian resources.

License

© Michael Naumov