Skip to main content
Tweeted twitter.com/#!/StackMma/status/470059272601358336
edited tags
Link
Kuba
  • 137.7k
  • 13
  • 289
  • 751
edited tags
Link
Kuba
  • 137.7k
  • 13
  • 289
  • 751
Source Link
Tyilo
  • 1.6k
  • 13
  • 26

Apply a function to the current selection in place

Say a have the function foo:

foo[x_] := x + 2

Like the Evalution -> Evaluate in place, I would like to have a keyboard shortcut that replaces the current selection with the result of applying foo to the selection.

For example if I have selected 1+3 in a cell with the following contents:

2*1+3-5

By pressing a keyboard combination, I want Mathematica to replace it with the result of foo[1+3] (6):

2*6-5