sponsor Vim development Vim logo Vim Book Ad

ScreenShot : ScreenShot.vim enables you make screenshot of your VIM session as HTML code.

 script karma  Rating 92/37, Downloaded by 3623  Comments, bugs, improvements  Vim wiki

created by
Michael Schwarz
 
script type
utility
 
description
ScreenShot.vim enables you generate HTML code for screenshot of all open windows at once.
Windows layout will be preserved, and status line for every window will be displayed.
In other words, the resulted HTML will look the same as you VIM looks, with exception of menu, toolbar and other GUI items.
Here(http://community.livejournal.com/screenshot_vim/4086.html) you can see a few examples.

ScreenShot.vim defines three commands:
1) ScreenShot  -- to make screenshot itself
2) Text2Html -- to generate HTML code for syntax highlighting of  peace of selected text  or of all current buffer if nothing selected. This command resemles standard command TOhtml, though has a few differences:
   a) Generation of HTML code is designed in assumption that this code will occupy just a region of HTML page rather than all page, so it wrapped in <table> tag and has no <body> tag. Background color and default text color for this region of page will be setted properly.
   b) Width of resulted HTML will be always equal to the width of current window. When 'wrap' setting is on, lines longer than the width of the window will wrap and  displaying continues on the next line.  When off lines will not wrap and only part of long lines will be displayed. So, you do not need to take in account long lines which may broke you page.
   c) Foldcolumn will be displayed
3) Diff2Html -- to display two files comparing with differencies highlighted. You may select any part of the first file, and obtain HTML code for this part and corresponding part of the second file separated with vertical split line.

ScreenShot.vim has a few global options which are stored in global dictionary g:ScreenShot:

g:ScreenShot.Title -- is title bar enabled
g:ScreenShot.Icon -- is VIM icon displayed in title bar (disabling of icon can significantly decrease size of document)
g:ScreenShot.Credits -- are credits displayed
g:ScreenShot.force_background -- force background color to some specific values
g:ScreenShot.fill_screen -- force space from end of line to end of window to be filled with whitespaces(especially useful with command Text2Html to force highlighted text to occupy a region of HTML page with fixed width)

Color should be specified as a string in HTML color format #RRGGBB. This option may be useful as there is no reliable method to find out background color for console versions of VIM.

For instance, if you want to disable icon and credits you should insert in your vimrc :

let ScreenShot = {'Icon':0, 'Credits':0, 'force_background':'#FFFFFF'}

By default all these options enabled.


 
install details
Just copy to $VIMRUNTIME/plugin directory
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
ScreenShot.vim 1.07 2007-04-01 7.0 Michael Schwarz     1.07:
        Html size optimized
    Fixed:
        1. Status line %V item
        2. Proper embedding in HTML page with defined default color
ScreenShot.vim 1.06 2007-03-07 7.0 Michael Schwarz 1.06:
      Fixed:
        1. Folds are displayed correctly now(was broken in 1.05)
        2. Unprintable unicode chracters are displayed correctly now
1.05:
      Added:
        Good multibyte support(thanks Cyril Slobin <slobin@ice.ru> for suggestion)
ScreenShot.vim 1.04 2007-03-06 7.0 Michael Schwarz |1.04:
|Fixed:
|    1. Proper colors for DOS and win32 console versions(suggestion by Cyril Slobin <slobin@ice.ru>)
|    2. Black color is now default for background in console, even if no
|       "reverse" attribute set, because it is typical behaviour of terminals.
|Added:
|    3. 'force_background' option
|
|1.03: A few bugfixes by Cyril Slobin <slobin@ice.ru>
|Added:
|    7. Support for 256-color xterm
|
|1.0:
|Added:
|    1. Diff mode support
|    2. New command Diff2Html

ScreenShot.vim 0.9 2006-06-14 7.0 Michael Schwarz Added:
1)Custom statusline (i.e. 'stl' option support)
2)Tabline bar(only for console or if 'guioptions' does not contain 'e'). Custom tabline also supported .
3)Title bar with VIM logo (can be disabled). Custom title(i.e. option 'titlestring') also supported
4)Credits in right bottom corner(can be disabled)
5)A few global settings in dictionary g:ScreenShot
Removed:
An extra VertSplit line in the very right
ip used for rating: 107.23.85.179

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github