Loading xml files into the vim text editor
Posted: Sat Aug 08, 2026 4:17 pm
Looking through the data files for Distant Worlds 2, just to play "harder".
I've noticed that the line endings (\r\n (CRLF) comply to windows standards, but the content doesn't. Most or all of the descriptions contain LF, but not CR.
It's not a bug, but vim text editor seems setup to freak out about this situation.
After an googling furiously for a long time, I gave up. Next day I came up with this: simply load the file inside the vim command
Explanation
Cheers!
I've noticed that the line endings (\r\n (CRLF) comply to windows standards, but the content doesn't. Most or all of the descriptions contain LF, but not CR.
It's not a bug, but vim text editor seems setup to freak out about this situation.
After an googling furiously for a long time, I gave up. Next day I came up with this: simply load the file inside the vim command
Code: Select all
$ vi -R -c "e ++ff=dos Resou*" Code: Select all
-R #readonly
-c e # edit command
++ff= # override detection of file type