I want to take advantage of folding more often to help navigate my notes and focus on certain parts. I exclusively use Vim emulation and Live Preview in Obsidian, and while this works well for the most part with just a couple quirks (see Go To Link Command Inconsistencies with Cursor Position, Live Preview, and Vim Mode), one quirk prevents folds from being very useful to me.
Most commonly when I am navigating my note, I use
}. These keys jump from one blank line to the next or previous, jumping over entire blocks at a time. My hope is that I could use this to jump over the heading of a folded section. However, the Vim navigation has no “awareness” of the fold, and will jump to the next blank line inside the folded section, automatically expanding the entire thing.
Moving the cursor with Vim should not automatically expand the section. If I want to expand, I will explicitly click the fold arrow, or use the unfold hotkey.
Additionally, Vim bindings should have some “awareness” of the sections that are folded, treating them like a single line. Moving the cursor up and down should go onto the heading line and past it without unfolding. Using the
} should jump over the heading line with no regard for the content that is inside the folded section.
Another handy use case is when I put my cursor on the folded heading, and I want to add one below. So I press
o to open a line below, but this unfolds the section and inserts the line directly below the heading.
Current workaround is to avoid using folds entirely, to use the mouse to click on the “other side” of a fold (which is antithetical to using Vim bindings in the first place), or to use some Vim motion that is guaranteed to not enter the folded section (eg. going directly to a line number on the other side, which is not practical).
I simply don’t use folds because they can’t be effective to me with this behavior.