Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way to open openoffice.org documents inside vim, especially if it will preserve the formatting?

Ends up looking like:

PK^C^D^T^@^@^H^@^@N¢^E=^Æ2^L'^@^@^@'^@^@^@^H^@^@^@mimetypeapplicationvnd.oasis.opendocument.textPK^C^D^T^@^H^H^H^@N¢^E=^@^@^@^@^@^@^@^@^@^@^@^@^K^@^@^@content.xmlµXÛnã6^P}ïW^H*Ð7Y±Ó^B^[7ö¢À¢@<81>^D(<90>´è+M<8e>,îòV<92>²­~}<87><94>

share|improve this question
up vote 4 down vote accepted

I know for .sxw fies you change the file name to .zip, then unzip it then you'll be right to start looking in those files - maybe content.xml or something

share|improve this answer
    
Fascinating, that actually works! It complains of being malformed following recompilation, but that allows me to edit via vim, brilliant. – EricR Aug 6 '10 at 4:58

No, I'm afraid not. Vim is a text editor, not a word processor. While Vim "understands" the syntax of a variety of text file formats, it doesn't understand native OpenOffice file formats.

share|improve this answer

There is an even shorter way instead of renaming to zip:

au BufReadCmd *.odt,*.ott,*.ods,*.ots,*.odp,*.otp,*.odg,*.otg call zip#Browse(expand("<amatch>"))

This will directly open the file as zip in vim

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.