Home

Awesome

[!NOTE] Due to lack of time, this plugin has been archived. Please switch to a newer and maintained 3rd/image.nvim.

<h1 align="center">image.nvim</h1> <p align="center"> <b>Image Viewer as ASCII Art for Neovim, written in Lua</b> </p> <p align="center"> <a href="https://github.com/samodostal/image.nvim/issues"> <img src="https://img.shields.io/github/issues/samodostal/image.nvim" alt="Issues"/> </a> <a href="https://github.com/samodostal/image.nvim/stargazers"> <img src="https://img.shields.io/github/stars/samodostal/image.nvim" alt="Repository's starts"/> </a> <a href="https://github.com/samodostal/image.nvim/blob/master/LICENSE"> <img src="https://img.shields.io/github/license/samodostal/image.nvim" alt="License"/> </a> <a href="https://github.com/samodostal/image.nvim/commits/main"> <img src="https://img.shields.io/github/last-commit/samodostal/image.nvim" alt="Latest commit"/> </a> </p> <p align="center"> <img src="https://user-images.githubusercontent.com/44208530/215286501-80d355f4-5b67-4b6a-a584-9ef63c061089.gif" alt="animated" width="100%" /> </p>

Features

How does it work?

When you open an image file (e.g. portrait.png), the open buffer becomes non-editable and non-saveable to ensure the file contents won't be overwritten. Then the buffer is filled with the ascii art generated by ascii-image-converter. I found out that a plugin similiar to this was already implemented for vim in vimscript: image.vim, so you can consider this a modern, lua version.

Prerequisites

Install

With packer

use {
  'samodostal/image.nvim',
  requires = {
    'nvim-lua/plenary.nvim'
  },
},

With vim.plug

Plug 'samodostal/image.nvim'
Plug 'nvim-lua/plenary.nvim'

Setup

-- Require and call setup function somewhere in your init.lua
require('image').setup {
  render = {
    min_padding = 5,
    show_label = true,
		show_image_dimensions = true,
    use_dither = true,
    foreground_color = false,
    background_color = false
  },
  events = {
    update_on_nvim_resize = true,
  },
}

Colors support:

Colors are turned off by default.