Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shortcut key for changing code cell to markdown cell in jupyter notebook

Kind of silly, but is there a shortcut key to change a code cell to markdown cell?
To place a markdown cell, I have to insert a cell, then go to the toolbar menu (below the main menu bar), and then select "Markdown" instead of "Code".

like image 491
VivekDev Avatar asked Dec 13 '17 07:12

VivekDev


People also ask

How do you turn a cell into a markdown?

select the code cell, press "esc + m ",and it will be a markdown cell. moreover, from markdown cell to code cell, press " esc + y ". Just tried this on a Jupyter Notebook on VSCode and it works like a charm, thank you!

What is the shortcut for markdown in Jupyter Notebook?

Markdown cells can be selected in Jupyter Notebook by using the drop-down or also by the keyboard shortcut 'm/M' immediately after inserting a new cell.

How do you switch cells in Jupyter Notebook?

Here I have chosen the shortcuts Ctrl + Shift + ↓ and Ctrl + Shift + ↑ . Finally, press Ctrl + S to save changes. Now, when you are in the command mode, you should be able to move one or more selected cells up or down. The shortcuts will even appear in the menu Edit -> Move Cells Up and Edit -> Move Cells Down .

How do I change the code to text in a Jupyter Notebook?

Simply Enter Esc and type m it will convert to text cell.


2 Answers

Press M whilst in command mode (highlight around the selected cell should be blue, not green), use Esc to switch to command mode and Enter to switch back to edit mode.

So, if you're editing a cell, the key presses to change the cell to a markdown cell are Esc, M, Enter.

You can look up all the Jupyter notebook keyboard commands by pressing the keyboard icon in the toolbar. You can also edit your keyboard shortcuts by going to Help > Edit Keyboard Shortcuts

like image 63
Louise Davies Avatar answered Sep 25 '22 07:09

Louise Davies


check help on the menu, there is keyboard shortcuts

select the code cell, press "esc + m ",and it will be a markdown cell. moreover, from markdown cell to code cell, press " esc + y ".

like image 28
Irene Lee Avatar answered Sep 22 '22 07:09

Irene Lee