Add command palette function to move note's enclosing folder using `Move folder to...` dialog

Use case or problem

There is an option to move a folder exposed in the popup menu when right-clicking on a folder, but there is no corresponding command.

Proposed solution

Create a command, Move enclosing folder, that can be called from the command palette when editing/viewing a file. Allow it to be bound to a hotkey if we desire but do not bind by default. (I would not bind it, but some may want to)

Scenario:

  1. User opens a file in Obsidian and reads/edits it
  2. User decides to move the entire folder the file is in
  3. User opens the command palette and fuzzy-finds the command Move enclosing folder
  4. Obsidian displays the same popup menu as the existing right-click Move folder to... function
  5. User fuzzy-finds the desired folder and presses Enter
  6. The folder containing the current file is moved to the selected folder
  7. Obsidian displays a toast notification Folder moved (or better: Folder moved to: [path from vault root])

Current workaround (optional)

Move mouse, find enclosing folder, right-click, then proceed from step 5.

Related feature requests (optional)

Obsidian currently provides no toast notification confirming success on file or folder moves. I will open a separate feature request and link them together.

2 Likes

+1 for this