I still can't figure out how to format on save in Xcode. Or format in general?
Then make CMD+s the shortcut.
I use the workaround of Command-A, command-X, command-V aka “Select All, Cut, Paste”.
Unfortunately that loses cursor position in the file and gives you a free newline at the end of your content.
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1...:
“3.206 Line
A sequence of zero or more non- <newline> characters plus a terminating <newline> character.”
That’s consistent with:
> echo test | wc
1 1 5
> echo -n test | wc
0 1 4