aome510 / spotify-player

A Spotify player in the terminal with full feature parity
MIT License
2.95k stars 132 forks source link

[feature]: move cursor 10 lines down and up by pressing ctrl+d and ctrl+u respectively #470

Closed diegoulloao closed 2 weeks ago

diegoulloao commented 2 weeks ago

Is your feature already implemented in the latest master? No

Is your feature request related to a problem? Please describe. No

Describe the solution you'd like Some editors like nvim and vim allows you to move the cursor 10 lines down by pressing ctrl+d and up by ctrl+u. It would be cool to have this feature to move quickly throughout the list, playlist or search results.

aome510 commented 2 weeks ago

It should already be possible with PageSelectPreviousOrScrollUp and PageSelectNextOrScrollDown. You can configure the page size with page_size_in_rows config option.

diegoulloao commented 2 weeks ago

It should already be possible with PageSelectPreviousOrScrollUp and PageSelectNextOrScrollDown. You can configure the page size with page_size_in_rows config option.

I mean, for vim/nvim users it would be great to do it using the ctrl+d and ctrl+u keybindings too. Those two ways could live together. There are also other terminal applications that are using the same keybindings to move around up and down (vim inspired I guess). I'd be very nice to have it here too.

aome510 commented 2 weeks ago

You can add bindings to ctrl+u and ctrl+d right?

diegoulloao commented 2 weeks ago

You can add bindings to ctrl+u and ctrl+d right?

idk, it is possible? how?

aome510 commented 2 weeks ago

You can add bindings to ctrl+u and ctrl+d right?

idk, it is possible? how?

add

[[keymaps]]
command = "PageSelectNextOrScrollDown"
key_sequence = "C-d"
[[keymaps]]
command = "PageSelectPreviousOrScrollUp"
key_sequence = "C-u"

to keymap.toml

More details: https://github.com/aome510/spotify-player/blob/master/docs/config.md#keymaps

diegoulloao commented 2 weeks ago

Great, I didn't know about this. Anyway I think it would be great to have these keymaps built-in the app. But this keymap.toml absolutely works! Thanks.