Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support certain commands in preview mode #20

Open
wenlzhang opened this issue Jan 13, 2022 · 7 comments
Open

Support certain commands in preview mode #20

wenlzhang opened this issue Jan 13, 2022 · 7 comments

Comments

@wenlzhang
Copy link

It would be great if certain commands can work in preview mode/reading view, e.g. Go to previous/next heading.

@timhor
Copy link
Owner

timhor commented Jan 14, 2022

I'm not sure how this would work, since there's no cursor or selection to use as a starting point?

@wenlzhang
Copy link
Author

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?

@timhor
Copy link
Owner

timhor commented Jan 14, 2022

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.

@timhor
Copy link
Owner

timhor commented Jan 14, 2022

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.

@wenlzhang
Copy link
Author

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?

@timhor
Copy link
Owner

timhor commented Jan 17, 2022

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

@wenlzhang
Copy link
Author

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!

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

No branches or pull requests

2 participants