obsidian-editor-shortcuts
obsidian-editor-shortcuts copied to clipboard
Support certain commands in preview mode
It would be great if certain commands can work in preview mode/reading view, e.g. Go to previous/next heading
.
I'm not sure how this would work, since there's no cursor or selection to use as a starting point?
there's no cursor or selection to use as a starting point?
This indeed can be an issue. How about always make the first or last header as the staring point then?
Well, by 'starting point' I'm essentially referring to an anchor from which you would search for the next or previous heading. For example, if your cursor was on line 3, character 5 in edit mode, the command to Go to next heading
would look for the next heading after that exact position. If you don't have a corresponding anchor in preview mode and instead always assign it to search from the first or last heading, it's not ideal for navigating between headings since you'd need to step through every single one.
If your use case is simply to jump between various headings while reading, I'd suggest using the Outline plugin (you'll find it under Core plugins). That will display a list of headings in the current file which allows you to click to jump to a particular heading.
That will display a list of headings in the current file which allows you to click to jump to a particular heading.
Thanks for the suggestion. However, with the outline plugin, one needs to use it to navigate among headings by clicking them in the side pane? Is it possible to navigate among headings by using hotkeys, without needing to open the side pane?
Ah, Outline doesn't support hotkeys as far as I'm aware. I just had a quick search though and found Quick Switcher++, which can be mapped to a hotkey. See if that works for you instead.
I can experiment with your original request at some point, but it'll be a while before I have the time to do that. I've tracked it here in the meantime: https://github.com/timhor/obsidian-editor-shortcuts/projects/1#card-76194970
I just had a quick search though and found Quick Switcher++, which can be mapped to a hotkey. See if that works for you instead.
Thanks for the help!