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
Change autocomplete on tab to ctrl-space #10440
Comments
Basically, you just need to add this code to any startup file in your profile: from prompt_toolkit.keys import Keys
from prompt_toolkit.key_binding.bindings.completion import generate_completions
ip = get_ipython()
bind_key = ip.pt_cli.application.key_bindings_registry.add_binding
bind_key(Keys.ControlSpace)(generate_completions) You should really always check that you're running the terminal with PTK before you run that code though. Something like this should work: def register_bindings():
from prompt_toolkit.keys import Keys
from prompt_toolkit.key_binding.bindings.completion import generate_completions
bind_key = ip.pt_cli.application.key_bindings_registry.add_binding
bind_key(Keys.ControlSpace)(generate_completions)
ip = get_ipython()
if getattr(ip, "pt_cli"): register_bindings()
del register_bindings Note: You could put the registration logic in an if-block, but using a function stops names like |
It worked! Thank you for getting back to me so quickly! |
When I try to run the above, I get |
write the following to your user preferences of keyboard shortcuts
|
@Pravinkumar2629 The first and second object of the shortcuts array in your example are identical. Is this intended? |
Hello,
I'd like to change the key binding for autocomplete to ctrl-space. I had read about it here: http://ipython.readthedocs.io/en/latest/config/details.html#keyboard-shortcuts. But I'm not sure how I would do it.
The text was updated successfully, but these errors were encountered: