63

There is probably a very easy solution to this but I'm not sure what it is. Delete cell command in IPython 1.2 used to be:

ctrl-m d 

according to the help menu in version 2.0 it says,

Shift-d: delete cell(press twice) 

I've tried holding shift then pressing d twice and various combinations with shift and d and nothing seems to work.. Am I just doing this wrong or the command is actually not working? Any help would be appreciated.

2 Answers 2

92

In the new IPython cells could have two states: when it has a green selection rectangle around it you can edit what's inside; when it has a grey rectangle around it you edit the cell itself (copy/paste/delete). Enter/Return makes it go green, Esc makes it go grey. When it is gray, 'dd' will delete it.

Sign up to request clarification or add additional context in comments.

2 Comments

Turns out that Vimium overrides this command and prevents it from working, for those who encounter this issue in the future!
This dd shortcut worked out to me, however cell selection's color is blue nowadays
31

To delete a cell, just click on the part margin part of the cell, the part that is not code or output ( right below the Ln[7]: in the picture below), and simply press the d key twice. Clicking there selects the entire cell and allows you to use keyboard short cuts like delete and or create a cell above or below.

enter image description here

3 Comments

Oh okay great. This is actually not a bad feature since I would have to click inside the cell anyways to use ctrl-m d
interesting. So why does the documentation say "shift"?
At least in version 3, nowhere it mentions shift. Just d + d. Also I found out that if you just press and hold d then your cells will start deleting and you can't undo but only the last deleted cell by pressing z.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.