A plugin for automatically uploading images to an image hosting service in Neovim, currently only supporting markdown syntax.
- Command
:UploadImgTwo requirements:
- 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",
},
},
}- 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 ]]
}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:
- mistgc/pinmd.nvim - Picture In Markdown. A plugin written in Lua for Neovim to paste images from the clipboard.
- ekickx/clipboard-image.nvim - Neovim Lua plugin to paste images from the clipboard.
