Skip to content

kanon-H/image-upload.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image-upload.nvim

A plugin for automatically uploading images to an image hosting service in Neovim, currently only supporting markdown syntax.

Usage

  • Command
 :UploadImg

Demo Image

Installation

Two requirements:

  1. Install the curl command
  2. Install picgo (or piclist)
  • lua.init
# Local test mode
return {
  dir = "/Users/kanon/workset/dev/workspace/nvim-workspace/vim-plugin-learnself/image-upload.nvim",
  opts = {
    files = {
      location_for_new_attachments = "specified_folder_in_vault",
      attachment_folder_path = "asset/images",
    },
  },
}

Configuration

  • Custom configuration:
opts = {
  http = {
    url = "http://picture.up.com/upload",
  }
}
  • Default configuration:
default_opts = {
  http = {
    url = "http://127.0.0.1:36677/upload",
  },
  command = [[curl -s -H "Content-Type:application/json" -X POST ]]
}

Acknowledgements

This is my first time writing a Neovim plugin, and there may be many areas that are not standardized or comprehensive. I warmly welcome valuable suggestions from experts for functional improvements.

While writing markdown documents in Neovim, I found that there was no plugin to automatically upload images to an image hosting service. Therefore, through learning on Bilibili and referring to open-source plugin codes on GitHub, I initially completed this image upload feature. I would like to thank the following projects for their reference:

  1. mistgc/pinmd.nvim - Picture In Markdown. A plugin written in Lua for Neovim to paste images from the clipboard.
  2. ekickx/clipboard-image.nvim - Neovim Lua plugin to paste images from the clipboard.

About

A plugin for automatically uploading images in Neovim

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages