Using Vim to edit Microsoft Word files

Kilon picture Kilon · Sep 23, 2010 · Viewed 21.6k times · Source

I've found ViEmu, a vi emulator for microsoft word. However, I wanted to use vim to edit DOC or even rtf files. Is this possible ?

Are they any other formats that preserve page/paragraph layout compatible with both Microsoft Word and Vim? I am also open to OpenOffice formats.

Answer

Konrad Rudolph picture Konrad Rudolph · Sep 23, 2010

That’s not possible. Vim is by its very nature a plain text editor and doesn’t offer Microsoft Word style WYSIWYG. You cannot edit formatted documents.

To be sure, you can edit the source code of an RTF file (RTF is a fairly simple formatting language so editing it manually is theoretically possible) but I don’t think this is what you’re after.

If you want to edit using Vim but still produce documents with formatting, your best shot is LaTeX. This allows you to create professional documents via a macro programming language.