[IPython-dev] Shortcut to convert cell between code and markdown while remaining in edit mode?

Maximilian Albert maximilian.albert at gmail.com
Sun Apr 20 13:09:22 EDT 2014

Hi all,

First of all a big word of thanks to the entire team for all the great and
hard work! I'm using IPython for pretty much all of my work and it gets
better and better by the day and is a joy to use. :)

I have a small remark/request about the new modal interface for the
notebook. I really like it in most ways, but it would be great if there was
a way to convert a cell from code to markdown (and vice versa) *without
having to leave edit mode*.

Background: I frequently find myself in a situation where I just executed a
code cell and now want to enter a few descriptive sentences for the next
piece of code. So I start typing, but since I just executed a code cell the
current cell is also a code cell. I realise this after a few words and then
have to execute three key strokes:

   Esc  -> go into command mode
   m  -> convert cell to markdown
   Enter  -> enter edit mode

Since all of these keys are at different positions on the keyboard, it
makes this process a bit cumbersome, especially because I always lose half
a second or so between each key stroke to check whether it actually did
what I expected it to do. It's not a major problem, but it is annoying
enough to get in my way because it interrupts the mental flow while I'm
focusing on how to write a (possibly non-trivial) explanation for the next
bit of code.

So it would be great if there was a way to simply convert a cell from code
to markdown with a single keyboard shortcut, while *remaining in edit mode*.


- Currently, the shortcuts "Ctrl-m" and "Esc" have the same meaning in edit
mode (viz., "enter command mode"). Why not change the meaning of "Ctrl-m"
to: "convert current cell to markdown and remain in edit mode"? This plays
nicely with the fact that "m" on its own (without Ctrl) converts a cell to
markdown when in command mode.

- It would be nice to have a similar shortcut for the "reverse" operation
"convert current cell to code cell and remain in edit mode". I would have
suggested "Ctrl-y" for this (due to the same mnemonic reason, since "y"
alone has the same meaning in command mode). But this is already used for
"redo". But I'd be happy with any other shortcut, too.

Apologies for this long email for such a simple request. Thanks for
reading, and thanks for considering it!

Best wishes,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140420/05c48b0d/attachment.html>

More information about the IPython-dev mailing list