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

i Ctrl-C instead of Ctrl-U #35

Closed
Paul-Aime opened this issue Feb 17, 2022 · 3 comments
Closed

i Ctrl-C instead of Ctrl-U #35

Paul-Aime opened this issue Feb 17, 2022 · 3 comments

Comments

@Paul-Aime
Copy link

The default behavior is currently to "Send Ctrl-U to clear the line before sending commands to IPython".
But that fails if the cell has multiple lines.

Ctrl-C should be sent instead because it cleans the whole cell.
Actually, i Ctrl-C should be sent because the user may use VIM mode for IPython and be in navigation mode

So first send i to enter insert mode, then Ctrl-C to clear the cell, and finally %paste -q to execute the cell.
Right now only ste -q is sent (because insert mode is entered only after the a)

btw, thanks a lot for the amazing plugin!

@hanschen
Copy link
Owner

hanschen commented Feb 21, 2022

Thanks for the suggestion, I'll look into it. I think I considered using Ctrl-C in the beginning but don't remember why I decided against it. I think the behavior of Ctrl-C has also changed - it used to show the previous input followed by ^C (actually I prefer this behavior...) rather than clearing everything.

@hanschen
Copy link
Owner

Sorry for the long wait, I've been a bit busy lately.

I've now implemented the feature and made it the default behavior. Please update and see if it works as expected. :)

For people who prefer the old behavior, you can set the following in your .vimrc (or equivalent):

let g:ipython_cell_send_ctrl_c = 0
let g:ipython_cell_send_ctrl_u = 1

@Paul-Aime
Copy link
Author

After some quick tests, it seems to work like a charm, thanks a lot!

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

No branches or pull requests

2 participants