3

My system of code organization in Mathematica is such that that after a block of code that achieves a specific goal I create a new cell and skip 4 or 5 lines in it, and write new code in the next line.

This is, of course, very messy -- but it would become much easier and more standardized if I could define a shortcut for it.

So is there a way for me to define a shortcut that

  1. Creates a new cell;

  2. Skips 4 lines and leaves the cursor on the fifth one.

Any advice is also appreciated.

GaloisFan
  • 405
  • 2
  • 7
  • 1
    There is probably a style for padding around cells. You could edit your style sheet to add padding above input cells. Then you wouldn’t need new lines at all. – lericr Oct 20 '22 at 06:13
  • 3
    SelectionMove[InputNotebook[], After, Cell]; NotebookWrite[InputNotebook[], StringRepeat["\n", 5]] + https://mathematica.stackexchange.com/a/217028/5478 – Kuba Oct 20 '22 at 06:57
  • @lericr I had no idea about the style sheet. Could you point me to a reference on how to handle setting a new one up? – GaloisFan Oct 20 '22 at 07:11
  • @Kuba exactly what I wanted, thank you very much! – GaloisFan Oct 20 '22 at 07:11
  • @GaloisFan here are some starting points: http://reference.wolfram.com/language/guide/Stylesheets.html and http://reference.wolfram.com/language/workflowguide/StylingAndFormatting.html – Victor K. Oct 20 '22 at 08:49

0 Answers0