Shoot allows users to take screenshots of code in vim
Example:
Output:
Use the command :TOpng
to capture a screenshot of the selected lines (or the whole buffer if no lines are selected).
The image will be saved in vim's working directory.
g:shoot_zoom_factor
- Used to zoom image (default: 2)g:shoot_browser_binary
- Specify the web browser binary file in the case of a non-standard installationg:shoot_save_path
- Specify the directory to save the images in
- Vim compiled with python3 support (check this with
:echo has('python3')
) - Python 3
- Chrome or Firefox (a browser based on either of these should work too)
Add one of the following to your vim-plug plugin list in your .vimrc.
Plug 'jmckiern/vim-shoot', { 'do': '\"./install.py\" chromedriver' }
Plug 'jmckiern/vim-shoot', { 'do': '\"./install.py\" geckodriver' }
Then run :PlugInstall
This will install the plugin and run the install.py script. This script does two things. First, it installs the selenium and requests packages. Second, it downloads the appropriate binary for the specified webdriver. These are all isolated to the plugin's local directory.
Remove the Plug 'jmckiern/vim-shoot'
line from your .vimrc and run :PlugClean
Vim already has a built in :TOhtml
command which will generate a html file
that displays the selected lines. Using selenium and a WebDriver, a headless
browser is started to render the output of :TOhtml
. This is then resized and
a screenshot is taken.