Code Monkey home page Code Monkey logo

nvimager's Introduction

nvimager

repo size license contributions welcome standard-readme compliant

Inline markdown image/gif/video/pdf/LaTeX previewer for nvim using ueberzug.

Designed for use with vimwiki using markdown syntax.

nvimagerbannerlong

Table of Contents

Install

Dependencies
nvimager Download using your preffered plugin manager, otherwise here are instructions for Vim-Plug.
  1. Install junegunn/vim-plug.

  2. Add plugin to vim-plug block in vimrc.

call plug#begin[]
  Plug 'mbpowers/nvimager'
call plug#end[]
  1. Add keybinding in vimrc.

nmap <leader>qq <Plug>NvimagerToggle

  1. Restart nvim, and run :PlugInstall.

Usage

Nvimager matches text in the buffer to the following patterns:

Dynamic Previews

[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.
Static Previews

[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 PreBufWrite and replaced PostBufWrite, 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.
Block Previews
  • TODO

example

Configuration

Options

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'

Acknowledgements

Scripts

vimg

animated_thumbnail_gen.sh

neovim-plugins-in-lua

Maintainers

@mbpowers

Contributing

PRs, issues and feature suggestion welcomed.

If editing the README, please conform to the standard-readme specification.

License

MIT © 2022 mbpowers

nvimager's People

Contributors

mbpowers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

nvimager's Issues

Crash

I followed the instructions but I get this error message on <Plug>NvimagerToggle:

1 change; before #494  2 seconds ago
E5108: Error executing lua ...le/.local/share/nvim/lazy/nvimager/lua/nvimager/init.lua:157: attempt to concatenate a nil value
stack traceback:
	...le/.local/share/nvim/lazy/nvimager/lua/nvimager/init.lua:157: in function 'createTexPreview'
	...le/.local/share/nvim/lazy/nvimager/lua/nvimager/init.lua:236: in function 'init'
	...le/.local/share/nvim/lazy/nvimager/lua/nvimager/init.lua:292: in function 'toggle'
	[string ":lua"]:1: in main chunk
E354: Invalid register name: '#'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.