Skip to content

feat(commands): add ObsidianMoveNote with folder picker and buffer pa…#873

Open
daikiejp wants to merge 1 commit into
epwalsh:mainfrom
daikiejp:main
Open

feat(commands): add ObsidianMoveNote with folder picker and buffer pa…#873
daikiejp wants to merge 1 commit into
epwalsh:mainfrom
daikiejp:main

Conversation

@daikiejp
Copy link
Copy Markdown

Summary

  • Add a new :ObsidianMoveNote command to move the current markdown note to another folder inside the active vault.
  • Open a folder picker rooted at the vault root (supports configured pickers: telescope/fzf-lua/mini.pick, with vim.ui.select fallback).
  • Keep the current buffer synced to the moved file path, while handling no-op and collision cases safely.

Behavior

  • Validates that the current buffer is a markdown note within the active vault.
  • Lists vault folders (including vault root as /) and lets the user select a target.
  • Aborts when target folder is the same as current or when a file with the same name already exists.
  • Saves the buffer, moves the note, removes the old file, and keeps the user in the moved note buffer.

Testing

  • Added test coverage in test/obsidian/note_spec.lua:
    • ObsidianMoveNote should include the vault root in folder options
  • Ran:
    • make test TEST=test/obsidian/note_spec.lua
  • Result:
    • 18 passed, 0 failed

Compatibility

  • ObsidianMoveNote command uses vim.fs.dir (0.8) and vim.ui.select (0.8) :)

…th update

Add :ObsidianMoveNote to move the current note to a selected vault
folder (configured picker or vim.ui.select fallback), prevent
collisions/no-op moves, and keep the active buffer updated to the new
file path.
@daikiejp daikiejp mentioned this pull request Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant