Nheko-Reborn / nheko

Desktop client for Matrix using Qt and C++20.
https://nheko-reborn.github.io/
GNU General Public License v3.0
1.89k stars 199 forks source link

Vi-style bindings #584

Open ghost opened 3 years ago

ghost commented 3 years ago

Navigation would be infinitely easier with more bindings; we already have ctrl + k to move between users, rooms and the like, but if we some to scroll up and down, focus items or even edit text, that would make the experience more cohesive.

Vi-style bindings are the most popular out of the options, Emacs (I guess, that's pretty much it), which makes it the most comfortable for the most people.

deepbluev7 commented 3 years ago

I mean, we do have Page Up/Down to scroll, ctrl-up/down to switch rooms, alt-up/down to reply, up/down to edit, etc. I don't think Vi style bindings are a good fit, since we don't have one buffer, but multiple layers. So to implement something like this, I would need a lot more to the proposal, like what key should do what and what modes should there be?

ghost commented 3 years ago

I think the movement ones are the most important, hjkl, all we'd have to do is replace the existing ones.

deepbluev7 commented 3 years ago

Yes, but how do you switch to movement mode, where does it move (room list or message input or timeline) and how do you enter insert mode again?

ghost commented 3 years ago

Sorry for the late reply. I was busy. Maybe have it start in movement mode and then have insert bound to ctrl + i? Something like tab could be used to switch between the room list, message input and timeline.

yousefamar commented 3 years ago

I think the tricky part here is vi-style keybindings both within the chat input box (as if it were a vi buffer), as well as for room and timeline navigation. Either of these can exist easily on their own, but combining the two is hard.

@ghost Tbh, I'm not a fan of this switching between the 3 areas of focus, because it just adds a lot of extra keystrokes/steps and cognitive load. To be more concrete: a common workflow for me is to go down rooms one by one and quickly answer messages. It would drive me crazy to have to toggle through panels and back just to do that. Not to mention it would need visual hints to show what's focused.

I would therefore suggestion a sort of hybrid:

The ability to customise keybinds would probably solve the two first points already and probably be a feature with wider appeal. I'm not sure how hard the third point would be (or if there's some existing lib for Qt that can just be slotted in) but it would be a nice extra.