How to clear all output cells and run all input cells
You can edit the file KeyEventsTranslation.tr
to define new keyboard shortcuts. As mentioned by R.M. in this answer, you can copy this file from the $InstallationDirectory
to the $UserDirectory
and perform those changes in the latter (see the linked answer for details.)
Not all combinations of keys will work, since many are already bound by default. You can however comment the corresponding lines in the file to make them inactive and available for other actions.
The following codes are based on the keys "j"
, "v"
, "w"
, and "x"
, with the modifiers Control
and Shift
. These are not bound by default and work well on Windows.
Use a keyboard shortcut to clear all output cells and run all input cells.
This can be obtained from points 2 and 3 below by combining the FrontEnd`FrontEndExecute
's.
Use a keyboard shortcut to run all input cells.
Item[KeyEvent["v", Modifiers -> {Control, Shift}], FrontEnd`FrontEndExecute[{ FrontEnd`FrontEndToken["EvaluateNotebook"] }]]
Use a keyboard shortcut to clear all output cells.
Item[KeyEvent["w", Modifiers -> {Control, Shift}], FrontEnd`FrontEndExecute[{ FrontEnd`FrontEndToken["SelectGeneratedCells"], FrontEnd`FrontEndToken["Clear"] }]]
Use a keyboard shortcut to clear all variables and definitions from memory (a global clear).
Item[KeyEvent["j", Modifiers -> {Control, Shift}], KernelExecute[Remove["Global`*"]], MenuEvaluator -> Automatic ]
Delete current cell with a keyboard shortcut.
Item[KeyEvent["x", Modifiers -> {Control, Shift}], FrontEnd`FrontEndExecute[{ FrontEnd`SelectionMove[FrontEnd`InputNotebook[], All, Cell], FrontEnd`FrontEndToken["Clear"] }]]
References
Rebinding keys to define new keyboard shortcuts
What is the complete list of valid Front End Tokens?
Use a keyboard shortcut to clear all output cells and run all input cells.
Use a keyboard shortcut to clear all output cells.
I don't think a keyboard shortcut for this exists. Menu item Cell -> Delete all output is your best bet.
Use a keyboard shortcut to run all input cells.
CTRL+A -> SHIFT+ENTER in a notebook without any weird content.
Use a keyboard shortcut to clear all variables and definitions from memory (a global clear).
Keyboard shortcut doesn't exist for this, Clear["Global/`*"]
or even quitting the kernel with Quit
are your best options
Delete current cell with a keyboard shortcut.
What I normally do is arrow down once to go after the cell, press SHIFT+UP ARROW, and then press DELETE. Quick and easy in my day to day use.