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 shortcut to edit cell #9929
Conversation
No objection for F2. Is this 5.2 material ? |
It's a simple enough addition that I'd be inclined to backport it to 5.x. |
Fair enough, let's add F2 for Py2. |
I've integrated some code _carlsmith posted on the mailing list to open the current cell in a text editor to edit a larger chunk of code. This reduces the need for `%edit`, and has the benefit that edited code goes into the IPython history. What should the shortcut be? Carl used **Ctrl-N**, but nothing about that says 'edit' to me. I've gone for **F2**, which is used in Excel to edit the selected cell, and I've enabled it for both emacs and vi keybindings. If we don't use an F-key (or something funky like Insert), we probably need separate emacs and vi shortcuts.
Can vimmers also get "v" (in command mode) for this purpose? It is the equivalent shortcut in vi-mode for bash & friends. |
Sounds reasonable. Do you want to make a PR adding it? See |
Thanks for adding this @takluyver. P.S. I only went with |
Funny, in my case, it doesn't seem to respect |
Strange. Try updating Prompttoolkit. |
IPython 5.2.2 |
Ah my
|
Ha ! Need to be fixed in prompt_toolkit. As things get passed manually to As a workaround create a
That should work. |
On OSX, users will typically use `subl -w` to use sublime tet on blocking mode, though this will be passed ass it to subprocess.call leading to the `subl -w` command not found. See ipython/ipython#9929 this should fix that. It would affect users with actual space on the path of their editor executable, but I'm unsure how to handle both case. It seem to me like passing flags would be the most common use case. Workaround is to tell users to create an shim executable which pass the options.
I've submitted a patch to prompt toolkit. |
I'll wait for the patched prompt-toolkit |
On OSX, users will typically use `subl -w` to use sublime tet on blocking mode, though this will be passed ass it to subprocess.call leading to the `subl -w` command not found. See ipython/ipython#9929 this should fix that. It would affect users with actual space on the path of their editor executable, but I'm unsure how to handle both case. It seem to me like passing flags would be the most common use case. Workaround is to tell users to create an shim executable which pass the options.
See #9929 issuecomment-276264230.
I've integrated some code @carlsmith posted on the mailing list to open the current cell in a text editor to edit a larger chunk of code. This reduces the need for
%edit
, and has the benefit that edited code goes into the IPython history.What should the shortcut be? Carl used Ctrl-N, but nothing about that says 'edit' to me. I've gone for F2, which is used in Excel to edit the selected cell, and I've enabled it for both emacs and vi keybindings. If we don't use an F-key (or something funky like Insert), we probably need separate emacs and vi shortcuts.