Skip to content

feat(navigation): add support for vi bindings (h = left and l = right) #1408

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sassman
Copy link

@sassman sassman commented Dec 21, 2020

This PR replaces #608 because it seems to be that the original author is gone.

Also, I propose to only handle the keys for rightArrow (l) and leftArrow (h) here, for the key bindings to navigate back and forth for whole sections in the sidebar I am planning to bring up a new PR.

 - navigation to previous is `h` key similar to left arrow
 - navigation to next is `l` key similar to right arrow
@ehuss
Copy link
Contributor

ehuss commented Jan 4, 2021

Thanks for the PR! I'm a little reluctant to merge something like this because the existing keybindings have caused various issues with extensions and input fields (see #1020, #1244). I'm uncertain, but maybe the keybindings should inspect the target similar to how the search bindings work? Unfortunately, I don't fully understand the issues involved, so I'm not sure if that makes sense.

@sassman
Copy link
Author

sassman commented Jan 4, 2021

@ehuss thanks for the feedback. I will have a closer look at those mentioned issues and see if your suggestion is applicable in that context.

@sassman
Copy link
Author

sassman commented Jan 4, 2021

PS: just keep in mind that on almost every site even here on GitHub there are key bindings available.
? for a help overlay, / for the search, j and k for navigation purpose. So I'd say that is some sort of best practice.

@szabgab
Copy link
Contributor

szabgab commented Mar 21, 2025

I think I'd start by creating a help overlay to show the existing mappings.
Then I'd create a way for the author of the book to define mapping in the book.toml file and would default LeftArrow and RightArrow as it is now.

@rustbot
Copy link
Collaborator

rustbot commented Apr 30, 2025

☔ The latest upstream changes (possibly #2681) made this pull request unmergeable. Please resolve the merge conflicts.

@rustbot rustbot added the S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. label Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants