Set explicit line ending for all files in PIO editor

PlatformIO uses OS default line endings:

  • CR for Unix;
  • CR/LF for Windows.

Git fixes the line endings on commit.

However, Markdown TOC extension uses only CR as ending.
How to set explicit line ending to PIO as CR for all files?

You can change the current EOL for an open file via this clickable button on the status bar:

To set the EOL for new files, you want Files: EOL preference

For a bunch of existing files, you’ll need some tool like dos2unix or other to do the batch conversion.