rssguard icon indicating copy to clipboard operation
rssguard copied to clipboard

[FR]: Vim keybindings

Open Logarithmus opened this issue 3 years ago • 7 comments

Issuehunt badges

Hello. I like your feed reader, but I also fond of (Neo)VIM. Yes, I've heard about newsboat, but I prefer GUI for a thing like mail client or feed reader. I'd love to have best of both worlds: an ability to use my keyboard in order to traverse my email & news in efficient manner, as well as have native Qt/GTK UI which respects my system-wide theme.


IssueHunt Summary

Backers (Total: $2.00)

Become a backer now!

Or submit a pull request to get the deposits!

Tips

Logarithmus avatar Dec 25 '20 15:12 Logarithmus

@logarithmus has funded $2.00 to this issue.


issuehunt-oss[bot] avatar Dec 25 '20 15:12 issuehunt-oss[bot]

@Logarithmus Can you perhaps ellaborate on this ticket?

I literally know nothing about Vim and although I consider myself Linux power-user I almost entirely stick with nano or micro.

Can you write in great detail what exactly is meant by "keybindings"? Do you simply want to have "special" keyboard shortcuts mode which will re-assign individual actions to shortcuts which mimic Vim behavior? Because, RSS Guard is not really text editor nor it runs in terminal. Therefore I wonder what actual actions (to what actualy shortcuts) would you need to map?

I checked Vim shortcuts and there are shortcuts which change "mode" (this is not really applicable to GUI application like RSS Guard or am I wrong?), similar stuff like moving cursor one character right? left? I am quite confused at this point. 👍

Maybe just write a list of very specific actions to sample shortcuts you would like, something like:

Action Shortcut
Go to next message )
Go to previous message (
... ...

martinrotter avatar Dec 30 '20 19:12 martinrotter

@martinrotter I've been using Sway (tiling window manager) & NeoVIM only for a couple of months. Despite that, I already feel big productivity boost coming from them. The main advantage is keyboard-driven workflow. When using conventional mouse-driven GUI programs, your right/left hand constantly jumps back and forth between the keyboard & the mouse. Sure, many GUI programs have shortcuts to deal with this problem, but unfortunately, this shortcuts are not very convenient to use. Or better said, not as conveneint as they could be.

For example, to traverse between posts in a specific feed, or between feeds in a list of feeds, you can use arrow keys, PageUp, PageDown, Home, End. These keys, especially the latter ones, are located quite far from your keyboard's home row. Home row is "ASDF GHJKL" row on QWERTY keyboards. It's called "home" because this row is a starting position for your fingers if you use touch typing. If you look closely at standard Vim's keybindings, you will find that most of them consist 1 or 2 letters, also the most frequently used keybindings are either located on home row or close to it. Summing up, when you use Vim, your fingers & hands move as few as possible.

Obviously, many people who use Vim would like to have familiar & convenient keybindings in other software. So they created mail clients (mutt & neomutt), feed readers (newsboat) and other programs. But almost all of those programs are terminal-based and consequently have not so nice UI.

There are even browser extensions with Vim keybindings! I personally use one of them in chromium, called Vimium. It makes navigation between tabs & on the web much faster for me. You can scroll pages with i j k l (scroll a bit), d u (scroll half a page) and gg Shift+G (jump to top/bottom of the page). You can switch to left/right tab by pressing Shift+J and Shift+K (compare that to default Ctrl+Shift+Tab and Ctrl+Tab). Press f, after that Vimium marks all visible links with 1-2 letter sequences, then type this sequence. Whoa, you have just opened this link! Press Shift+F and it will open the link in new tab. You can even switch to visual or insertion mode and select text without using a mouse! I myself don't use this feature and still use touchpad to select text.

I hope you will get my points.

About writing down the list of possible shortcuts: I should definitely take time to do that. Personally I didn't really used newsboat, only read about it & watched videos.

Logarithmus avatar Dec 30 '20 20:12 Logarithmus

@Logarithmus Makes more sense now. Table of all needed shortcuts would be really helpful here anyway. Also, note that any multi-character shortcuts like gg would make this ticket greatly more difficult to implement, but if we stay with simply shortcuts, then this is really doable and it's fair to say, that you could just re-map individual actions even with current RSS Guard manually, but it's fair to say that adding Vim "mode" would make it all easier to setup.

Will wait for the table to arrive. No stress, brother.

martinrotter avatar Dec 31 '20 18:12 martinrotter

@Logarithmus Could you eventually provide the desired table we spoke about above? Btw. One more thing. If I understood everything correctly, RSS Guard already is able to do exactly what you want! It already offers actions for all basic operations which can be assigned to keyboard shortcuts. Make sure to investigate "Settings -> Keyboard shortcuts" well. For example, there are actions: Select next/previous item (in feed list), Select next/previous (unread) message etc. You can assign individual shortcuts to those. Some of those actions even have by default some (rather crazy) shortcuts assigned, for example pressing W moves you to next message.

So you basically want to avoid configuring all that by hand and you want me to add a "preset" which will re-configure some shortcuts to specific vim-friendly-like keyboard buttons.

Waiting for the table then. :)

NOTE: Technically, RSS Guard can do only "classis" one-key shortcuts -> shortcuts which include one normal button, like "A" and up to three modifiers (CTRL, ALT, SHIFT, TAB, etc.). Keep that in mind. Compound shortcuts like "gg" are very difficult to implement.

martinrotter avatar Jan 26 '21 08:01 martinrotter

Not sure if it does? Plus, maybe some of these manual configurations would be better in the default?

For instance arrow keys don't always do anything where you could give them a useful action? For instance if a feed is selected, pushing (or enter) could go into the list of messages in that feed, and vice versa (or escape) goes back to the feeds. Hitting or return from the message list could go to the content of a message. There the current action of arrows; go down/up, already makes sense, would suggest escape there goes back to the message list.

Another one i suggest is switching tabs with control-pageup/pagedown, browsers have this too.

These could all be tied to commands, which are on keybinds? So @Logarithmus can also bind his version that adds the vim ones. (probably make a few presets so people spend less time configuring stuff..)

o-jasper avatar Feb 12 '21 20:02 o-jasper

man i really want vim keybinds for this i kinda have it but i cant jump between windows (Messages,Articles,Folders) and use hj(up,down) to navigate to them

so i want keybinds of alt + hjkl to jump focus between windows aka(press alt + l to change focus to messages and just continue using jk to scroll up n down and when i want to open the message i just press l to close it press h, in the message i can use shift+g to jump to the start of the article and gg to jump to the end of the aricle same applies to every windows you have focused on) and yeah i just want bare minimum keybinds and that it.my brain will thank you for that

little video of what i want

https://user-images.githubusercontent.com/45166203/183310033-f91754ff-0b6d-42d6-b5b9-5b4a011d536b.mp4

the icing on the cake would be if you can add numbered inputs

example of vim

y4w - yank four words

d7w - delete seven words

10j - go down by ten lines.

i think you get it.

fislysandi avatar Aug 07 '22 20:08 fislysandi