gitu icon indicating copy to clipboard operation
gitu copied to clipboard

Search

Open altsem opened this issue 1 year ago • 4 comments

Search down/up in any screen. Bind to / and ?, n and N to go to next/prev?

n is currently bound to moving the cursor down. May want to bind ? to help. Does it make more sense to have separate vim/emacs-like keybind profiles?

altsem avatar Feb 20 '24 19:02 altsem

This would be great!

My guess is that people who prefer Emacs-like keybindings are likely to use Emacs and prefer to stay in Emacs, hence use Magit rather than gitu. So I'd argue that it makes sense to focus on making a good workflow for those using vim-style keybindings (which seems to be gitu's default). In particular, I'd support removing the p and n bindings to select previous/next to enable them to be used for other things.

(Note: I use vim-style keybindings for code editing and I'm a Magit user who basically only uses Emacs - with Evil mode for vi-style keybindings - for Magit, so I bring some hefty bias :sweat_smile:)

That said, it's going to be hard to get anything perfect - I'd love to be able to use h and l for fine-grained text selection when in visual mode (for example to search for a commit by message, then copy something like the hash), but there are obvious conflicts with help and log actions. You could get around that with full-on modes like Vim has, but I imagine that adds significant implementation complexity, and increases the barrier to entry for those not used to Vim. Certainly not worth consideration in the short term.

mattgallagher92 avatar Mar 19 '24 14:03 mattgallagher92

I think dropping n/p for navigation might be reasonable. In the future, the keybinds should be configurable anyway. Been thinking about adding a "copy hash" keybind somewhere.

altsem avatar Mar 20 '24 17:03 altsem