Use case or problem
I would like commands and hotkeys to quickly navigate between the different “foldable structures” in a file. When I say foldable structures, I really mean headers and lists (unsure if any other structures can be folded), with the down arrow, where clicking the down arrow results in the content being folded.
Proposed solution
I propose that the following 3 VSCode commands to be implement in Obsidian:
- “command”: “editor.gotoNextFold”
- navigates the cursor to the next foldable structure in the current hierarchy
- “command”: “editor.gotoPreviousFold”
- navigates the cursor to the previous foldable structure in the current hierarchy
- “command”: “editor.gotoParentFold”
- navigates the cursor to the parent foldable from where the cursor is at
Example
With the following MD content:
# Parent Header
- L1 list 1
- L2 list 1
- L3 list 1
- L3 list 2
- L2 list 2
- L2 list 3
- L3 list 3
- L1 list 2
- From “L1 list 1”, using
gotoNextFold
will bring the cursor to “L1 list 2” - From “L2 list 1”, using
gotoNextFold
will bring the cursor to “L2 list 3”- “L2 list 2” is not foldable, so go to “L2 list 3” instead
- From “L3 list 1”, using
gotoNextFold
will do nothing since “L3 list 2” is not foldable - From “L3 list 2”, using
gotoParentFold
will bring the cursor to “L2 list 1” - From “L2 list 1”, using
gotoParentFold
will bring the cursor to “L1 list 1” - From “L1 list 1”, using
gotoParentFold
will bring the cursor to “Parent Header”