Skip to content

idea: move the current line with g, G, u, d and follow it with the view #974

Description

@reobin

What do you want to change?

Today g, G, u and d scroll the view first, then the current-line marker jumps to the edge of the view.

Proposed: these four keys move the current line, and the view follows.

  • g: line to the first row, view to the top
  • G: line to the last row, view to the bottom
  • d: line down half a screen, view follows; u is the reverse

j/k already work this way. The rest of the motions like mouse wheel, scrollbar, and page keys (space, b, f) don't change. They stay scroll first, cursor follows.

Why?

  • The marker does not end up where you looked. After d, it is dragged to the top edge of the view, with no context around it.
  • The keys can feel unresponsive. Press d until the view reaches the bottom of the stream: the marker sits at the top edge, and pressing G changes nothing on screen, because the marker only follows the view.
  • Editors like vim do it this way: the cursor moves, and the view follows.

Version: 0.20.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions