nvim: Allow pasting images into markup files
With the new `img-clip.nvim` extension we can copy any image anywhere and simply paste it into a markdown/quarto/latex/typst/... document with the right markup already. Those can be from the web/locally. Also allows drag and drop from e.g. web pages. Mapped to `<leader>pp` currently, though we will have to find a better mapping. Or invoked with `:ImagePaste`.
This commit is contained in:
parent
3b1a874883
commit
b2c64a0925
3 changed files with 25 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
local writing_ft = { "quarto", "pandoc", "markdown", "text", "tex" }
|
||||
local writing_ft = { "quarto", "pandoc", "markdown", "text", "tex", "typst" }
|
||||
|
||||
local prose_plugs = {
|
||||
-- UI improvements
|
||||
|
|
@ -69,6 +69,26 @@ local prose_plugs = {
|
|||
ft = writing_ft,
|
||||
},
|
||||
|
||||
-- easy copy paste of images into markup files
|
||||
{
|
||||
"HakonHarnes/img-clip.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
filetypes = {
|
||||
quarto = {
|
||||
url_encode_path = true,
|
||||
template = "",
|
||||
download_images = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
cmd = { "PasteImage" },
|
||||
keys = {
|
||||
{ "<leader>pp", "<cmd>PasteImage<cr>", desc = "Paste image from system clipboard" },
|
||||
},
|
||||
ft = writing_ft,
|
||||
},
|
||||
|
||||
-- bring zettelkasten commands
|
||||
{
|
||||
"mickael-menu/zk-nvim",
|
||||
|
|
@ -111,6 +131,7 @@ local prose_plugs = {
|
|||
"ZkOrphans",
|
||||
},
|
||||
keys = {
|
||||
-- additional key instpirations https://github.com/al1-ce/MonolithVim/blob/master/after/ftplugin/markdown.lua
|
||||
{ "<leader>ni", "<cmd>edit ~/documents/notes/index.md<cr>", desc = "open index", silent = true },
|
||||
{ "<leader>nn", "<cmd>ZkNotes { sort = { 'modified' } }<cr>", desc = "note list" },
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue