Export Vim screen with multiple vertical splits to HTML ?

34 views
Skip to first unread message

Philip Rhoades

unread,
Dec 21, 2019, 5:21:46 AM12/21/19
to vim...@googlegroups.com
People,

I know about exporting Vim diffs to HTML but I have a situation where it
is convenient for me to look at a bunch of files in Vim each in a
vertical split. Now while it is convenient for me to look at these
files this way, I cannot easily share this convenient view with other
(non-tech) people. What I am thinking is that it would be nice to
export this view to HTML in the same way a diff view can be exported.
The end result I guess would be multiple, side-by-side HTML divs that
are independently vertically scrollable.

Can anyone comment if this is doable? - perhaps as a Vim plugin?

Thanks,

Phil.
--
Philip Rhoades

PO Box 896
Cowra NSW 2794
Australia
E-mail: ph...@pricom.com.au

Ben Fritz

unread,
Dec 22, 2019, 5:44:41 PM12/22/19
to vim_use


On Saturday, December 21, 2019 at 4:21:46 AM UTC-6, Philip Rhoades wrote:
People,

I know about exporting Vim diffs to HTML but I have a situation where it
is convenient for me to look at a bunch of files in Vim each in a
vertical split.  Now while it is convenient for me to look at these
files this way, I cannot easily share this convenient view with other
(non-tech) people.  What I am thinking is that it would be nice to
export this view to HTML in the same way a diff view can be exported.  
The end result I guess would be multiple, side-by-side HTML divs that
are independently vertically scrollable.

Can anyone comment if this is doable? - perhaps as a Vim plugin?



This sounds easy enough to implement and probably useful in some situations.

It's not a current feature however.

There might be a wrapper for this, all you'd really need to do is create two divs with scrolling enabled via CSS, put them in a table with the desired layout (or use CSS), and copy the body of the generated HTML for each window into each area. Then copy the styles into the header. There might be some more adjustment needed for line number IDs, etc. depending on your options.

You can make a feature request here if you want (for now, I'll migrate issues when I find a new home for the repository): https://bitbucket.org/fritzophrenic/vim-tohtml

I have not had much time for development on the plugin recently but this is certainly a feature I'd consider adding. Not sure of the best UI for it though.

There was a similar plugin to TOhtml but it looks like that also has been inactive recently. I thought maybe they had a feature like this but I don't see it right away in the description: https://www.vim.org/scripts/script.php?script_id=3113
Reply all
Reply to author
Forward
0 new messages