magmax/python-inquirer

Feature request: Vim+Emacs(Mac) keyword shortcuts for selection

zitudu opened this issue · 4 comments

I was wondering if it's possible to move cursor up/down-ward just like in vim or terminal?

That is:

j or Ctrl-N -> ↓
k or Ctrl-P -> ↑
h or Ctrl-B -> ←
l or Ctrl-F -> →

I believe giving users the chance to specify a different key combination to scroll up and down would be a nice addition and should be fairly easy to implement.
However, for some notorious key combinations (e.g., Ctrl-J or Ctrl-N) a change is required to python-readchar too -- If I am not mistaken they are not here.

Update:
I've added an issue and a PR for this.
Also, IMHO, I believe it would be better to change the issue, and feature request, to something like "Custom key codes for scrolling".

Looks like someone was working on this, but they didn't follow through. I have the code that provides this functionality (for vim atleast). I may implement Emacs

if you have the code ready, feel free to open a PR and I will review it.

But reading #102 (comment) I agree that it would probably be best to make this configurable (with the current behavior as defautl), instead of adding a bounch to the default behavior, possibly creating overlaps in functionalaty (for example j is usefull for yes if your aplication is in german, etc...)