Editing DOS files in Vim


If you’re writing a file in Vim that will end up on a DOS machine, use these:

set encoding="ISO8859-2"
set fileencoding="ISO8859-2"
set fileformat=dos

This is also the first addition to the lunchbox for this year :).

Author bio and support


Ruben Schade is a technical writer and infrastructure architect in Sydney, Australia who refers to himself in the third person. Hi!

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite bespoke cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or send a comment. Thanks ☺️.