IPython/Jupyter notebook shortcut not working on Mac
You have to first toggle the right cell state.
The newer version of IPython revamped the command structure, so that cells have two states: input mode, when the cell has a green outline, and command mode, when the cell has a grey outline.
When its green you can edit the content and run it. When its grey you can use the delete insert cell or copy commands.
Hitting Enter or Return activates the green state, while using Esc activates the grey state.
For example:
To delete a cell, use Esc to go in command mode, like the grey outlined cell below, and simply press the d key twice.
You first press Ctrl
and m
(don't press the minus key), that will put the interface in command mode. For deletion you then have to press d
twice.
On my mac, I use fn key, instead of ctrl, to make shortcuts work in iPython notebook (in Safari). For example,
- fn + d + d deletes a cell (d + d works too)
- fn + x cuts a cell
- fn + c copies a cell
- fn + z undoes an action,
and so on. As already noted above, you must press Esc before applying any of these shortcuts; that is, you first hit Esc to make a cell "grey", then you press fn + x to cut a cell.