GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - phmarek/vim-tosvg: ToSVG - Vimscript to export buffer as SVG

BranchesTags
Open more actions menu

Latest commit

 

History

8 Commits
8 Commits

Folders and files

NameName
Last commit message
Last commit date
plugin
plugin
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 

Repository files navigation

  • ToSVG - Vimscript to export buffer as SVG

When building documentation, it is sometimes easier to include a picture of source code than some formatted export of the sourcecode; for example, some CMS don't allow to include HTML and CSS directly.

Here it might be useful to use a SVG export - that allows copy/pasting the textual contents, doesn't wrap long lines, and can be scaled without loss of quality.

So, here's a vim plugin!

  • Usage

On the command line:

:TOsvg

This will create an SVG export and put it in a new buffer that you can write somewhere.

This can also be used with a line range.

  • Configuration

The script includes these settings:

  • g:to_svg_line_spacing - vertical spacing between lines. 1.0 looks to dense to me, default is 1.1.
  • g:to_svg_char_spacing - when zero, just inserts spaces; with a numeric value, used the SVG dx value for horizontal space. \ The best value depends on the font used, I like 0.8.
  • g:to_svg_font_size - default is 11, used in the CSS as a pixel size. Also used to calculate the total dimensions of the viewBox.
  • g:to_svg_background - default is transparent; by setting it to a color, you'll get the SVG's background colored in.
  • g:to_svg_font_family - default is monospace.
  • License

LGPL v2.1; if you change something in this plugin, please tell me about it, eg. via a pull request. Thanks! (C) 2021 Philipp Marek, see git changelog.

  • TODOs
  • Optional filename and writing without opening a buffer
  • Background color (via rects?)
  • Hyperlinks?

About

ToSVG - Vimscript to export buffer as SVG

Resources

Readme
LGPL-2.1 license
Activity

Stars

10 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.