Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Vim-like keybinds #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

AndrewOlsen
Copy link

This adds vim-like keybinds in addition to the arrow keys for moving throughout the interface.
Since k is used for navigation, I am proposing to use s to stop the stream.

@chronitis
Copy link
Owner

Thank you for contributing, and sorry about the delay - busy week.

This looks good, but I'm a bit wary about changing the meaning of an existing keybinding (and probably one of the more commonly used ones). The basic keymap might not be ideal, but unfortunately it exists now. Possibly this should live under a config option or command line switch, although I'm open to other suggestions.

@AndrewOlsen
Copy link
Author

No worries!

I think a config file would do the trick. It would allow the user to specify their own keybinds, not just vim-like ones.

What are your thoughts?

@chronitis
Copy link
Owner

chronitis commented Oct 10, 2017

Yes, a config file would probably work. Doubtless there are other things it can be used for, like the hardcoded OPML root it currently uses.

The xdg library (pyxdg on pypi) should let you get the appropriate config dir (~/.config/curseradio), and either python's configparser or something similar like toml would work well for config.

Edit: let me have a look at adding a config mechanism myself for the next couple of days, since that's probably slightly out-of-scope of this PR.

@chronitis
Copy link
Owner

Preliminary support for a config file has been added. If you create ~/.config/curseradio/curseradio.cfg with contents:

[interface]
keymap=vim

[keymap.vim]
up=k
down=j
start=g
end=G
pageup=K
pagedown=J
stop=s

you should get some more vim-familiar behaviour. The config format should probably not be considered stable (input on a better design welcome).

@oblitum
Copy link

oblitum commented Dec 16, 2017

Would be nice to have this merged.

@chronitis
Copy link
Owner

chronitis commented Dec 17, 2017

The only changes in this branch seem to be changing the list of keybinding in README.md, but no changes to code? Do you have something uncommitted or unpushed?

Adding a default set of vim-keybinding should presumably now consist of a mapping in curseradio/curseradio.py CONFIG_DEFAULT['keymap.vim'] (line 35 or so).

Edit: sorry, released that comment is not from the original author. If this pull gets updated to add a (optional) vim keymap, I'm happy to include it.

@eyJhb
Copy link

eyJhb commented May 6, 2018

@chronitis what needs to be done, for this to get merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants