gitu icon indicating copy to clipboard operation
gitu copied to clipboard

More flexible cursor movement

Open lionel- opened this issue 10 months ago • 3 comments

I love this project, thanks for doing this!

One thing I miss from Emacs is the flexibility in commands for moving the cursor. In gitu navigating the log history can feel quite slow at times. Would it be possible to make the navigation commands more diversified or flexible? E.g. move cursor 5 lines, move to top or bottom of screen, etc.

For reference yazi has a very flexible configuration scheme for this: https://yazi-rs.github.io/docs/configuration/keymap#manager.arrow

Argument/Option	Description
[steps]	The number of steps the cursor moves up or down.

[steps] can be one of the following values:

    n: Move the cursor n lines up or down, negative for up, positive for down.
    n%: Move the cursor n% of the screen height up or down, negative for up, positive for down.
    "top": Move the cursor to the first file.
    "bot": Move the cursor to the last file.

lionel- avatar Feb 19 '25 08:02 lionel-

These exist as of now:

<alt+k>/<alt+up> Prev section
<alt+j>/<alt+down> Next section
<alt+h>/<alt+left> Parent section
<ctrl+u> Half page up
<ctrl+d> Half page down

In my mind, these should be introduced.

  • Search: /
  • Go to top: gg, though g is bound to refresh the view (move to another key?)
  • Go to bottom: G
  • Repeated up/down (more?): 10j, 4k

altsem avatar Mar 01 '25 13:03 altsem

I know (and love) keyboard shortcuts, but sometimes I find myself clicking a commit/stash/hunk with the mouse instinctively. This works in magit, and it would be great if it worked in gitu too. So I'd like to throw improved mouse support into the flexible cursor ring, please. 🥺

jonathanj avatar Jul 18 '25 06:07 jonathanj

FWIW, #422 addressed my comment about mouse support, which is usually faster for me to skip around the UI than jumping up/down N lines.

jonathanj avatar Sep 25 '25 11:09 jonathanj