GithubHelp home page GithubHelp logo

midick / vim-imager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from benzanol/vim-imager

0.0 0.0 0.0 240 KB

Display real images (not just ascii) inside of vim using Üeberzug

License: GNU General Public License v3.0

Shell 1.42% Vim Script 98.58%

vim-imager's Introduction

Vim Imager

Display real images (not just ascii) inside of vim using Überzug This plugin will only work in terminal vim/neovim and while running X11.

For more information about Überzug check out the github page:
https://github.com/seebye/ueberzug

Installation

Installing Überzug

Make sure that python3 is installed, and run the following command:
pip3 install ueberzug

Install with Vim Plug

Add the following to your vimrc
Plug 'qaiviq/vim-imager'

Then reload vim and run the command PlugInstall

Install with Vundle

Add the following to your vimrc
Plugin 'qaiviq/vim-imager'

Then reload vim and run the command PluginInstall

Inserting an Image

Imager will insert an image wherever you place the following text in your file:
<<img path="PATH-TO-IMAGE" height=HEIGHT-IN-LINES>>

For example, to insert the image ~/Pictures/MyImage 5 lines high, you would use:
<<img path="~/Pictures/MyImage" height=5>>

You can also specify a path relative to the file you are inserting the image into. If the image you wanted to insert was in the same directory as the file, you could use:
<<img path="MyImage" height=5>>
or alternatively
<<img path="./MyImage" height=5>>

If the image was in the directory above the current file, its relative path would be:
<<img path="../MyImage" height=5>>

This dot pattern continues, meaning that for each higher up directory, simply add another dot. If you wanted to acces the image ~/MyImage from the file ~/Documents/Misc/Notes/MyNote.txt, the relative path would be:
<<img path="..../MyImage" height=5>>

If you wanted to insert images into code, any string of characters can be inserted before or after the image declaration to make it a comment, and it will still work.
# <<img path="MyImage" height=5>>
// <<img path="MyImage" height=5>>
<!--<<img path="MyImage" height=5>>-->

Configuration

Specify a list of filetypes to enable imager in:
let g:imager#filetypes = ['.md']

Enable imager automatically for all files:
let g:imager#all_filetypes = 1

Disable imager temporarily (for example, to edit the displayed images)
:DisableImages

Enable imager if it is disabled
:EnableImages

Toggle imager being enabled or disabled
:ToggleImages

Forcibly reload all displayed images
:ReloadImages

Screenshots

With imager disabled

imager-off-screenshot

With imager enabled

imager-on-screenshot

vim-imager's People

Contributors

benzanol avatar

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.