Skip to content

Skardyy/neo-img

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neo-Img

🖼️ A Neovim plugin for viewing images in the terminal. 🖼️

Static Badge


Demo.mp4

Features ✨

  • Automatically preview supported image files
  • Oil.nvim preview support
  • Caching

Installation 🚀

uses ttyimg
you can install it in 2 ways:

  • via :NeoImg Install (recommended)
  • globally via go install github.com/Skardyy/ttyimg@v1.0.5, make sure you have GOPATH in your path export PATH="$HOME/go/bin:$PATH

Using lazy.nvim:

return {
    'skardyy/neo-img',
    build = ":NeoImg Install",
    config = function()
        require('neo-img').setup()
    end
}

Usage 💼

  • Images will automatically preview when opening supported files
  • Use :NeoImg DisplayImage to manually display the current file
  • you can also call require("neo-img.utils").display_image(filepath, win) to display the image in the given window

Configuration ⚙️

document files require

Libreoffice
  make sure its installed and in your path  
  * window: its called soffice and should be in C:\Program Files\LibreOffice\program 
  * linux: should be in the path automatically
require('neo-img').setup({
  supported_extensions = {
    png = true,
    jpg = true,
    jpeg = true,
    tiff = true,
    tif = true,
    svg = true,
    webp = true,
    bmp = true,
    gif = true, -- static only
    docx = true,
    xlsx = true,
    pdf = true,
    pptx = true,
    odg = true,
    odp = true,
    ods = true,
    odt = true
  },

  ----- Important ones -----
  size = "80%",  -- size of the image in percent
  center = true, -- rather or not to center the image in the window
  ----- Important ones -----

  ----- Less Important -----
  auto_open = true,   -- Automatically open images when buffer is loaded
  oil_preview = true, -- changes oil preview of images too
  backend = "auto",   -- auto / kitty / iterm / sixel
  resizeMode = "Fit", -- Fit / Strech / Crop
  offset = "2x3",     -- that exmp is 2 cells offset x and 3 y.
  ttyimg = "local"    -- local / global
  ----- Less Important -----
})

About

cross platform image viewer for neovim

Topics

Resources

License

Stars

Watchers

Forks

Languages