Skip to content

Add GNU "less" style navigation to --pager view #101

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
andrewwillowen opened this issue May 22, 2025 · 1 comment · May be fixed by #102
Open

Add GNU "less" style navigation to --pager view #101

andrewwillowen opened this issue May 22, 2025 · 1 comment · May be fixed by #102
Labels
enhancement New feature or request

Comments

@andrewwillowen
Copy link

Proposed Enhancement

I propose adding some of the basic GNU less navigation shortcuts to the --pager view.

Background

I enjoy the formatting and syntax highlighting that the rich CLI provides and want to use the --pager option to be able to quickly navigate the document while maintaining the rich display.

I use GNU less for most of my document paging needs and so found myself instinctively trying to use its navigation shortcuts in the --pager view, which of course failed. The current navigation shortcuts for the --pager view feel clunky, as well as incomplete. (Seems loosely inspired by vi, which is fine, but I prefer less over vi when I need to page through a large document because of the single-key navigation commands.)

Changes

Looks like the changes need to be applied to the pager.PagerApp.on_key() method. Since the existing shortcuts don't collide with the less shortcuts, can simply add additional elif statements, which means the prior functionality will be maintained (and not break other people's muscle memory).

Corresponding PR inbound shortly.

Additional context

Ideally, as suggested in #19 (comment) , it would be great to have several of the more common navigation keybindings available with the --pager view. Perhaps with a set of --pager-<bindings-scheme> options, e.g., --pager-emacs or --pager-vi? That seems like a more extensive set of changes than what I'm proposing.

@harkabeeparolus harkabeeparolus added the enhancement New feature or request label May 23, 2025
@harkabeeparolus
Copy link
Collaborator

I like this idea! I'll look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants