Builditluc / wiki-tui

A simple and easy to use Wikipedia Text User Interface
https://wiki-tui.net/
MIT License
405 stars 14 forks source link

[FEATURE] Vim Movements #161

Closed julianbuettner closed 1 year ago

julianbuettner commented 1 year ago

Is your feature request related to a problem? Please describe. I did expect this application to support basic vim movements.
wiki-tui is addressed to people, heavily relying on the terminal, so it would make sense to me.
Other popular command line tools like man, less, ranger, partially even tmux and vim itself of course, use vim movements.

Describe the solution you'd like I'd like to be able to use a few basic movements:

Describe alternatives you've considered Well, scrolling and klicking works fine, but feels a bit less fun.

Additional context No additional context.

Checklist

Foot note
If the feature is deemed acceptable or desirable to the community, I would be willing to try to implement it myself.

Builditluc commented 1 year ago

Hey @julianbuettner and thank you for your feature request! Vim movements are already there (not all of them, but the basics, more info can be found in the docs. Note: they were added per request in this issue).

Currently, h/j/k/l works, but Ctrl-d/Ctrl-u and ?// aren't implemented. Keyword search would require a rewrite of the drawing mechanism (it's messy down there, but I'm working on it), but half page up and down would be a nice addition.

To implement page up and down, you would need to add the keys to the config (document the change in the docs) and then to the RootLayout::wrap_on_event function. Because we currently only support rewriting the keybindings of actions given by our UI library cursive, we cannot implement our own (yet).

If you look into the on_event function, you can see what events need to be sent in the RootLayout::wrap_on_event function.

Please also make sure to read the docs about implementing a feature

If you have any questions regarding the codebase, feel free to ask me!

Builditluc commented 1 year ago

Thanks to @Enoumy, all of your requested keybindings except for the search-related ones are implemented, meaning I'm going to close the issue for now. Feel free to open it up again if you have other suggestions for keybindings!