I have a palette including this button:
CreatePalette[{
Button[
"m-editor",
Module[{modifyCodeStyle},(*by David Reiss*)
modifyCodeStyle[nb_NotebookObject, Notebook] :=
Module[{styledefs, editable},
editable = Editable /. Options[nb, Editable];
SetOptions[nb, Editable -> True];
styledefs = StyleDefinitions /. Options[nb, StyleDefinitions];
Switch[Head[styledefs], Notebook,
styledefs =
Notebook[{First@First[styledefs],
Cell[StyleData["Code"], PageWidth -> WindowWidth,
AutoIndent -> True, AutoSpacing -> True,
LineBreakWithin -> Automatic, LineIndent -> 1,
LinebreakAdjustments -> {0.85, 2, 10, 0, 1}],
Rest@First[styledefs]},
Sequence @@ Rest[List @@ styledefs]],
String | FileName | FrontEnd`FileName,
styledefs =
Notebook[{Cell[StyleData[StyleDefinitions -> styledefs]],
Cell[StyleData["Code"], PageWidth -> WindowWidth,
AutoIndent -> True, AutoSpacing -> True,
LineBreakWithin -> Automatic, LineIndent -> 1,
LinebreakAdjustments -> {0.85, 2, 10, 0, 1}]},
StyleDefinitions -> "PrivateStylesheetFormatting.nb"]];
SetOptions[nb, StyleDefinitions -> styledefs];
SetOptions[nb, Editable -> editable]];
modifyCodeStyle[SelectedNotebook[], Notebook]];
]
},
WindowTitle -> "fix editor"
]
the code for which I lifted from a post of David Reiss on the mathgroup.
To use it: open an m-editor, then click on the button. It will do what you want from there on. However, this must be repeated if you close and re-open the editor window.