sdb icon indicating copy to clipboard operation
sdb copied to clipboard

Optionally specify readline editing-mode

Open sdimitro opened this issue 6 years ago • 3 comments

Would folks be interested to support optional vi/vim and emacs editing mode in sdb that would be specified as a command argument? @ahrens @prakashsurya @pcd1193182 ?

This option would be dependent on the underlying readline library that your Python environment uses. If it is libedit for example, you will get an error message that changing keybindings is not supported. In most cases/installations though GNU readline is used which allows us to do things like this:

import readline
readline.parse_and_bind("set editing-mode vi")

https://docs.python.org/3/library/readline.html

sdimitro avatar Nov 21 '19 17:11 sdimitro

I would definitely be interested in adding readline support. Getting tab completion, keybindings, and rsearch would all be super useful.

pcd1193182 avatar Mar 11 '20 20:03 pcd1193182

I believe we already use readline; and tab completion (perhaps the others, too) should currently work.

I think this issue is more about adding the ability to use vi key-bindings (e.g. similar to set -o vi in bash) with readline.

prakashsurya avatar Mar 11 '20 20:03 prakashsurya

Ah, I see. I feel less strongly about that, since I just use the bash/emacs keybinds, but it's probably still a good idea.

pcd1193182 avatar Mar 11 '20 21:03 pcd1193182