Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there another way than pressing Ctrl+. until the whole cell is selected and then pressing Del?

If this is not built in, can I create some sort of a global macro to do this and bind it to a keyboard shortcut?

share|improve this question
up vote 13 down vote accepted

Referencing Szabolcs's answer, here is the code that must be added to

Item[KeyEvent["m", Modifiers -> {Control}],
        FrontEnd`SelectionMove[FrontEnd`SelectedNotebook[], All, Cell], 

I chose Ctrl+M at random; change it to whatever you want.

See this before you edit the file.

share|improve this answer
Change All, Cell], -> All, CellGroup], to delete the whole cell group, such as Input+Output group. Or change it to All, CellGroup, 2], to delete the cell group of level 2, and so on. – Vladimir Mar 11 '13 at 22:08
@Vladimir Thanks for the tips. – Mr.Wizard Mar 12 '13 at 1:24

I usually press the down key until I get out of the cell, then press shift-up to select it.

Here are two buttons that will select or delete the whole cell for you:

select = Button["Select Cell", SelectionMove[SelectedNotebook[], All, Cell]]
delete = Button["Delete Cell", SelectionMove[SelectedNotebook[], All, Cell]; 

CreatePalette[Column[{select, delete}]]

I'll leave it to others to set up keyboard shortcuts for these.

I would like to note that these actions don't require the kernel to execute. If you are going to send them to the front end for direct execution (FrontEndExecute), use the versions prefixed by FrontEnd`, i.e. FrontEnd`SelectionMove, etc. You could probably add this version directly to, but I don't have time to test it now.

share|improve this answer
+1 "I usually press the down key until I get out of the cell, then press shift-up to select it." ... Your Hired - TY. I'm a shortcut fanatic I hate mouse navigation. – Eddie B Nov 22 '12 at 3:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.