Originally created by: fritzophrenic
Original report by Ben Fritz (Bitbucket: fritzophrenic NA, ).
Setting 'wrap' in Vim can be (mostly) simulated in the TOhtml output using the g:html_pre_wrap option.
But this doesn't reflect the setting of 'breakindent', nor can it simulate 'nolinebreak' and 'breakat', nor does it attempt to simulate the 'showbreak' option.
Inspiration from "Bryce Orgill": https://groups.google.com/d/topic/vim_use/0eRfPISDhW8/discussion
Enhancement idea: simulate the wrapping by inserting linebreaks and spaces wherever Vim does this visually. Introduce new g:html_fake_wrap option or similar to manage whether real wrapping via pre_wrap or fake wrapping like this is used. Check the Vim tests of the 'wrap' and 'breakindent' options to see how Vim test suites are able to access what is actually displayed.
Unless recent HTML/CSS developments make even this craziness possible without inserting extra text...
Diff: