Nvimager
Inline markdown image/gif/video/pdf/LaTeX previewer for nvim using ueberzug.
Install / Use
/learn @mbpowers/NvimagerREADME
nvimager
Inline markdown image/gif/video/pdf/LaTeX previewer for nvim using ueberzug.
Designed for use with vimwiki using markdown syntax.

Table of Contents
Install
<details> <summary>Dependencies</summary>- Üeberzug (Necessary)
- pdftoppm (PDF/LaTeX)
- ffmpeg (Video)
- imagemagick (GIF/Video)
- pdfTex (LaTeX)
-
Install junegunn/vim-plug.
-
Add plugin to vim-plug block in
vimrc.
call plug#begin[]
Plug 'mbpowers/nvimager'
call plug#end[]
- Add keybinding in
vimrc.
nmap <leader>qq <Plug>NvimagerToggle
- Restart nvim, and run
:PlugInstall.
Usage
Nvimager matches text in the buffer to the following patterns:
<details> <summary>Dynamic Previews</summary>[name](file:path) or $ equation $
- Height is determined by number empty lines below (excluding line with EOF).
- Width is the width of the terminal.
- Will update on the fly on BufTextChanged.
[name](file:path)<!--widthxheight--> or TODO ~$ equation $<!--widthxheight-->~
- Width and height are measured in terminal cells.
- The html comment
<!--comment-->is allowed either two or three hyphens per side. - On creation a static image will insert filler text, consisting of full block characters, "█", in exactly the cells of the preview.
- Do not delete filler text! Filler text will be deleted upon BufWrite, deletion of the link pattern, or when nvimager is toggled off.
- Filler text is removed
PreBufWriteand replacedPostBufWrite, so you don't have to toggle to avoid writing filler lines to your file. - Do not have multiple static previews on one line!
- Must toggle nvimager to update size.
- TODO

Configuration
<details> <summary>Options</summary>You can set these in your init.vim:
| option | default | description | |-------------------------|---------------|----------------------------------------------------| | nvimager#autostart | 0 | start on BufEnter? | | nvimager#title | 1 | print titles? | | nvimager#dynamic_scaler | 'fit_contain' | see Üeberzug | | nvimager#static_scaler | 'forced_cover'| see Üeberzug |
let g:nvimager#autostart = 0
let g:nvimager#title = 1
let g:nvimager#dynamic_scaler = 'fit_contain'
let g:nvimager#static_scaler = 'forced_cover'
</details>
Acknowledgements
<details> <summary>Scripts</summary> </details>Maintainers
Contributing
PRs, issues and feature suggestion welcomed.
If editing the README, please conform to the standard-readme specification.
License
MIT © 2022 mbpowers
