Introduction
Jupyter Notebook is an interactive notebook program with rich shortcut keys to easily complete work. Notebook has two keyboard input modes. That is, command mode and edit mode, which are somewhat similar to Vim . In edit mode, you can type code or text into the cell. At this time, the cell is surrounded by a green frame, and the shortcut keys in command mode do not take effect. In command mode, you can use shortcut keys to run cells, move cells, switch the editing state of cells, etc. At this time, the cells are surrounded by a gray frame, and the shortcut keys in editing mode do not take effect.
- Install:
python -m pip install jupyter
- start up:
jupyter notebook
- Official website: http://jupyter.org
- Notebook online preview: https://nbviewer.jupyter.org/ , you can browse notebook documents written by others on GitHub, which loads faster than GitHub
hot key
Jupyter Notebook Shortcuts User Guide
To enter the edit mode from the command mode, press the Enter
key , and to switch from the edit mode to the command mode, press the Esc
key.
The following two tables are a brief description of the shortcut keys in the two modes of command and editing:
Command mode shortcuts (press Esc to open):
hot key | effect | illustrate |
---|---|---|
Enter | enter edit mode | |
Shift-Enter | Run this unit and select the next unit | New units default to command mode |
Ctrl-Enter | run this unit | |
Alt-Enter | run this unit and insert the new unit under it | New cells default to edit mode |
AND | Unit goes to code state | |
M | Unit goes to markdown state | |
R | Unit goes to raw state | |
1 | Set level 1 heading | It is recommended to use the title-related shortcut keys only in the markdown state. If the unit is in other states, it will be forced to switch to the markdown state. |
2 | Set level 2 headings | |
3 | Set level 3 headings | |
4 | Set level 4 headings | |
5 | Set level 5 headings | |
6 | Set level 6 headings | |
Up | Select the unit above | |
K | Select the unit above | |
Down | Select the unit below | |
J | Select the unit below | |
Shift-K | Continuously select the upper cell | |
Shift-J | Consecutively select the lower cell | |
A | Insert new cell above | |
B | Insert new cell below | |
X | Cut selected cells | |
C | Duplicate selected cells | |
Shift-V | Paste into cell above | |
V | Paste into cell below | |
WITH | undelete last unit | |
D,D | delete selected cells | Press two D keys in a row |
Shift-M | Merge selected cells | |
Ctrl-S | Save the current NoteBook | |
S | Save the current NoteBook | |
L | switch line number | The line number of the edit box can be turned on and off |
O | Convert output | |
Shift-O | Convert output scroll | |
Esc | close page | |
Q | close page | |
H | Show shortcut help | |
I,I | Interrupt the NoteBook kernel | |
0,0 | Restart the NoteBook kernel | |
Shift | neglect | |
Shift-Space | scroll up | |
Space | scroll down |
Edit mode shortcuts (press Enter to start):
hot key | effect | illustrate |
---|---|---|
Tab | code completion or indentation | |
Shift-Tab | hint | Output help information. Some functions, classes, methods, etc. will display their definition prototypes. If you add ? and more detailed help will be displayed. |
Ctrl-] | indentation | indent right |
Ctrl-[ | Unindent | indent left |
Ctrl-A | select all | |
Ctrl-Z | revoke | |
Ctrl-Shift-Z | redo | |
Ctrl-Y | redo | |
Ctrl-Home | skip to the beginning of the unit | |
Ctrl-Up | skip to the beginning of the unit | |
Ctrl-End | skip to end of cell | |
Ctrl-Down | skip to end of cell | |
Ctrl-Left | Skip to the left one initial | |
Ctrl-Right | skip to the right | |
Ctrl-Backspace | delete the previous word | |
Ctrl-Delete | delete the next word | |
Esc | switch to command mode | |
Ctrl-M | switch to command mode | |
Shift-Enter | Run this unit, select the next unit | New units default to command mode |
Ctrl-Enter | run this unit | |
Alt-Enter | Run this unit, insert a unit below | New cells default to edit mode |
Ctrl-Shift– | split unit | Split by the line where the cursor is located |
Ctrl-Shift-Subtract | split unit | |
Ctrl-S | Save the current NoteBook | |
Shift | neglect | |
Up | Move the cursor up or go to the previous unit | |
Down | Move the cursor down or go to the next cell | |
Ctrl-/ | Comment entire line/uncomment | Only code status is valid |
Note: If the shortcut key is occupied by other applications in the system, it may not work