mirror of
https://github.com/kristoferssolo/SoloVim.git
synced 2025-10-21 20:10:41 +00:00
Update 2025-05-03 Update 2025-05-05 Update 2025-05-07 Update 2025-05-09 chore: use mini.nvim Update 2025-05-12 Update 2025-05-14 Update 2025-05-16 Update 2025-05-17 Update 2025-05-20 Update 2025-05-21 Update 2025-05-23 Update 2025-05-25 Update 2025-05-30
55 lines
1009 B
Lua
55 lines
1009 B
Lua
local function is_typst()
|
|
return vim.bo.filetype == "typst"
|
|
end
|
|
return {
|
|
"HakonHarnes/img-clip.nvim",
|
|
event = "VeryLazy",
|
|
keys = {
|
|
{ "<leader>v", vim.cmd.PasteImage, desc = "Paste image from system clipboard" },
|
|
},
|
|
opts = {
|
|
default = {
|
|
dir_path = "assets/img",
|
|
extension = function()
|
|
if is_typst() then
|
|
return "png"
|
|
else
|
|
return "webp"
|
|
end
|
|
end,
|
|
process_cmd = function()
|
|
if is_typst() then
|
|
return ""
|
|
else
|
|
return "convert - -quality 75 webp:-"
|
|
end
|
|
end,
|
|
file_name = "%Y-%m-%d_%H-%M-%S",
|
|
relative_to_current_file = false,
|
|
prompt_for_file_name = function()
|
|
return is_typst()
|
|
end,
|
|
embed_image_as_base64 = false,
|
|
drag_and_drop = {
|
|
insert_mode = true,
|
|
},
|
|
},
|
|
filetypes = {
|
|
markdown = {
|
|
template = "![[$FILE_PATH]]",
|
|
},
|
|
vimwiki = {
|
|
template = "![[$FILE_PATH]]",
|
|
},
|
|
typst = {
|
|
template = [[
|
|
#figure(
|
|
image("$FILE_PATH", width: 80%),
|
|
caption: [$CURSOR],
|
|
) <$LABEL>
|
|
]],
|
|
},
|
|
},
|
|
},
|
|
}
|