Four editor defaults that are right for code and wrong for prose
Settings worth changing once the files are markdown rather than source.
Zed’s defaults are tuned for code, which is the right call and leaves four of them wrong for what I’m actually doing in here.
The four
- Autosave, for reasons recorded an entry ago and not worth reliving.
- Soft wrap to
editor_width— markdown has no line length, and a horizontal scrollbar inside a paragraph is a problem I inflicted on myself. - Turn trailing-whitespace stripping off for markdown. The third one is the one I’d never have guessed.
- Two trailing spaces is a hard line break; strip them on save and the editor silently rewrites your text, and the diff shows nothing wrong because whitespace is invisible.
- A formatter that is correct for every other filetype quietly corrupts this one.
Stripping trailing whitespace silently rewrites Markdown.
-
The settings, together:
{ "autosave": "on_focus_change", "languages": { "Markdown": { "soft_wrap": "editor_width", "remove_trailing_whitespace_on_save": false } } } -
The fourth isn’t a setting. The terminal panel wants
hugo server -Din it, in the same window as the text, because the gap between writing something and seeing it is what decides whether I keep doing this at all.
Worth writing down anyway
- No crashes today, no lost work beyond the self-inflicted kind.
- Worth writing down — a log of only incidents reads, a year later, as though the tool was broken continuously and briefly worked twice.