This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
gibson:teaching:fall-2016:math753:notebook-workflow [2016/09/02 06:18] gibson [Summary of notebook keyboard shortcuts] |
gibson:teaching:fall-2016:math753:notebook-workflow [2016/09/02 06:21] gibson |
||
---|---|---|---|
Line 43: | Line 43: | ||
All actions in the notebook can be performed with the mouse, but keyboard shortcuts are also available for the most common ones. The essential shortcuts to remember are the following: | All actions in the notebook can be performed with the mouse, but keyboard shortcuts are also available for the most common ones. The essential shortcuts to remember are the following: | ||
- | * **Shift-Enter: run cell.** Execute the current cell, show output (if any), and jump to the next cell below. If Shift-Enter is invoked on the last cell, a new code cell will also be created. Note that in the notebook, typing Enter on its own never forces execution, but rather just inserts a new line in the current cell. Shift-Enter is equivalent to clicking the Cell | Run menu item. | + | **Shift-Enter: run cell.** Execute the current cell, show output (if any), and jump to the next cell below. If Shift-Enter is invoked on the last cell, a new code cell will also be created. Note that in the notebook, typing Enter on its own never forces execution, but rather just inserts a new line in the current cell. Shift-Enter is equivalent to clicking the Cell | Run menu item. |
- | * **Ctrl-Enter: run cell in-place.** Execute the current cell as if it were in “terminal mode”, where any output is shown, but the cursor remains in the current cell. The cell’s entire contents are selected after execution, so you can just start typing and only the new input will be in the cell. This is convenient for doing quick experiments in place, or for querying things like filesystem content, without needing to create additional cells that you may not want to be saved in the notebook. | + | |
- | * **Alt-Enter: run cell, insert below.** Executes the current cell, shows the output, and inserts a new cell between the current cell and the cell below (if one exists). This is thus a shortcut for the sequence Shift-Enter, Ctrl-m a. (Ctrl-m a adds a new cell above the current one.) | + | **Ctrl-Enter: run cell in-place.** Execute the current cell as if it were in “terminal mode”, where any output is shown, but the cursor remains in the current cell. The cell’s entire contents are selected after execution, so you can just start typing and only the new input will be in the cell. This is convenient for doing quick experiments in place, or for querying things like filesystem content, without needing to create additional cells that you may not want to be saved in the notebook. |
- | * **Ctrl-m:** This is the prefix for all other shortcuts, which consist of Ctrl-m followed by a single letter or character. For example, if you type Ctrl-m h (that is, the sole letter h after Ctrl-m), IPython will show you all the available keyboard shortcuts. | + | |
+ | **Alt-Enter: run cell, insert below.** Executes the current cell, shows the output, and inserts a new cell between the current cell and the cell below (if one exists). This is thus a shortcut for the sequence Shift-Enter, Ctrl-m a. (Ctrl-m a adds a new cell above the current one.) | ||
+ | |||
+ | **Ctrl-m:** This is the prefix for all other shortcuts, which consist of Ctrl-m followed by a single letter or character. For example, if you type Ctrl-m h (that is, the sole letter h after Ctrl-m), IPython will show you all the available keyboard shortcuts. | ||
Here is the complete set of keyboard shortcuts available: | Here is the complete set of keyboard shortcuts available: | ||
Line 52: | Line 55: | ||
^ Shortcut ^ Action ^ | ^ Shortcut ^ Action ^ | ||
| Shift-Enter | run cell | | | Shift-Enter | run cell | | ||
- | | Ctrl-Enter | run cell in-place | | + | | Ctrl-Enter | run cell in-place | |
- | | Alt-Enter | run cell, insert below | | + | | Alt-Enter | run cell, insert below | |
| Ctrl-m x | cut cell | | | Ctrl-m x | cut cell | | ||
| Ctrl-m c | copy cell | | | Ctrl-m c | copy cell | |