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

scroll keybindings: top, bottom, page up, page down, page fractional #261

Merged
merged 3 commits into from
Aug 9, 2023

Conversation

mitchellh
Copy link
Contributor

Fixes #259
Related #227

This introduces a number of new keybindings, with default bindings on Mac and Linux:

  • scroll_to_top scrolls to the top of the viewport
  • scroll_to_bottom scrolls to the bottom of the viewport
  • scroll_page_up and scroll_page_down scroll by one page (number of visible rows) up or down, respectively
  • scroll_page_fractional takes a floating point argument and scrolls by visible_rows * fraction, i.e. 1 is equal to scroll_page_down but 0.5 would let you scroll a half page down.

Default keybindings on Mac:

  • cmd+home=scroll_to_top
  • cmd+end=scroll_to_bottom
  • cmd+page_up=scroll_page_up
  • cmd+page_down=scroll_page_down

Default keybindings on Linux:

  • shift+home=scroll_to_top
  • shift+end=scroll_to_bottom
  • shift+page_up=scroll_page_up
  • shift+page_down=scroll_page_down

Example customizing scroll_page_fractional (default unbound):

# Scroll a half page up
keybind = shift+page_up=scroll_page_fractional:-0.5

Demo:

CleanShot.2023-08-09.at.07.45.39.mp4

cc @andrewrk

@mitchellh mitchellh merged commit 5854be9 into main Aug 9, 2023
@mitchellh mitchellh deleted the scroll-page branch August 9, 2023 14:49
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

Successfully merging this pull request may close these issues.

scroll keybindings: top, bottom, page up, page down, etc.
1 participant