Easily take "screenshots" of your code in vim.
The actual code -> image transformation and the copy to the clipboard are
done with silicon, so you need to have it installed. It works on macOS and
Linux:
- macOS:
brew install silicon - Linux: your distro's package, or
cargo install silicon
Check out this small demo:
:Codeshot will put an image with your code in the system clipboard that you
can paste wherever you need.
The command uses ranges, so you can select some text to and invoke it to take a
partial shot, or in general use any range (:%Codeshot is the default when no
selection is available).
You can control the appearance of the code using the following options:
g:CodeshotStyle: Silicon theme (i.e. Color scheme). Runsilicon --list-themesfor a list of available themes. (defaultDracula)g:CodeshotFont: Font family. (defaultHack)g:CodeshotFontSize: Font size. (default32)g:CodeshotShowLineNumbers: Show line numbers. (default0for no line numbers,1will show them, numbered as in the buffer)
