Disable auto-formatting of code?

Hi, how do I disable auto-formatting of code in mathematica?

Redrawing and reformatting of the entire screen per every key stroke makes mathematica absolutely unusable (I can type one line of formula and then watch for 15 second paragraphs jumping up and down on the page). Also, mathematica’s randomly inserted/deleted line breaks make me crazy. Inserted line breaks make the code unreadable. Automatically deleted line breaks break the code (e.g., automatic concatenation of commented-out lines!). Also, automatic substitutions of character sequences to obscure utf8 characters make the code much harder to deal with. I have not yet seen so screwed-up text editor…

OS, version, example notebook, computer specs?

Ubuntu linux, mathematica 11.0, Intel Core i5–6500 3.20GHz with 8 GiB RAM; Ran over X forwarding (ssh with -XYC).

Example notebook: anything. E.g.,

(*helper function*)
MyJoin[l_, pts_] := 
 If[OddQ[Length[pts]], Join[l, pts], Join[l, Reverse[pts]]]

(*the algorithm itself*)

calcCasteljau[pts_, pts2_, t_] := 
 Table[pts[[i]]*(1 - t) + pts2[[i]]*t, {i, 1, Length[pts]}]
rankedCasteljau[pts_, t_, acum_] := 
 If[Length[pts] == 1, MyJoin[acum, pts], 
  rankedCasteljau[calcCasteljau[Drop[pts, -1], Drop[pts, 1], t], t, 
   MyJoin[acum, pts]]]

(*overloads for the basic casteljau algorithm-*)

casteljau[pts_, t_] := rankedCasteljau[pts, t, {}]
casteljauLast[pts_, t_] := {rankedCasteljau[pts, t, {}][[-1]]}

(*drawing functions*)

showCasteljau2[pts_, ptsOrig_] := 
 Show[ListPlot[pts, PlotMarkers -> Automatic], ListLinePlot[pts], 
  ParametricPlot[casteljauLast[ptsOrig, t], {t, 0, 1}]]
showCasteljau[pts_, t_] := showCasteljau2[casteljau[pts, t], pts]


Manipulate[
 showCasteljau[{{0, 0}, {0, 1}, {1, 1}, {1, 0}, {2, 0}, {2, 1}}, 
  t], {t, 0, 1}]

Slower response caused by the forwarding is of course anticipated. The problem is that:

  • that the entire screen is reformatted and rerenderred (with significant and anyway annoying changes) per every key stroke, which of course causes a lag when working with an X forwarded window. I want just to turn the formatting off so that it runs as smoothly as any normal text editor.

  • I do not want mathematica to tell me where my new-lines should be (e.g., any copy paste reformats the code)

Have you tried the “Code” cell style?

For such a short code it should be instantaneous actually. But maybe because you use it remotely makes it awkward. The cell style is by default “Input”. Try changing it to “Code”. Right-click on the bracket of any cell, choose style, and then “Code”.

Yes, ‘code’ behaves much better with respect to ‘user experience’.

With respect to the response, it does not improve the situation much. Highlight/autocomplete/indent functionality still triggers unneccesary redrawing.

I have a feeling this might be because it is done using software rendering. Anyhow, you can also disable syntax highlighting in the settings:

I’ve only used it locally and there it is instantaneously. Never had a problem with it…

Ah, here it is!

Yep, I was afraid of the limits of software-sided font rasterisation. Still, after disabling function highlights, movement works fine and the response is much more ‘regular’.

I guess this might be considered as solved. Thanks very much!

Alternatively you could also write a .m file (regular text file) and run that directly on the kernel… Then you can use any editor you like…

good luck!

Well, this is a perfect solution! I had no idea that there was a standalone interpreter.

In case someone stumbles upon this thread and wishes to use the commandline interpreter:

  • ‘$ ./WolframKernel’ provides the text interpretter

  • graphics output may be obtained by entering once '<< JavaGraphics` '. All graphics will then be automatically opened.

  • tmux, vim and slime (vim addon for output redirection) allow elegant workflow

You might also consider Workbench: Wolfram Workbench: Eclipse-based IDE for Wolfram Language