1
Fork 0
satellite/dotfiles/neovim/lua/my/plugins/clipboard-image.lua
2022-09-12 13:50:02 +02:00

29 lines
496 B
Lua

local M = {}
local function img_name()
vim.fn.inputsave()
local name = vim.fn.input('Name: ')
vim.fn.inputrestore()
if name == nil or name == '' then
return os.date('%y-%m-%d-%H-%M-%S')
end
return name
end
function M.setup()
require 'clipboard-image'.setup {
default = {
img_name = img_name
},
tex = {
img_dir = { "%:p:h", "img" },
affix = "\\includegraphics[]{%s}",
},
}
vim.keymap.set("n", "<leader>p", ":PasteImg<cr>")
end
return M