nvim: Overhaul prose preview keys

This commit is contained in:
Marty Oehme 2025-02-05 19:05:50 +01:00
parent 9421ef807d
commit 50d78cbb2f
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
5 changed files with 56 additions and 32 deletions

View file

@ -97,7 +97,7 @@ local prose_plugs = {
cmd = "RenderMarkdown",
keys = {
{
"<leader>pp",
"<localleader>pm",
function()
require("render-markdown").toggle()
end,
@ -106,29 +106,43 @@ local prose_plugs = {
},
},
},
--- PREVIEW SECTION
-- generate an auto-updating html preview for md files
-- uses the very nice peek if deno is available, otherwise falls back to markdown-preview
{
"toppair/peek.nvim",
event = { "VeryLazy" },
cond = vim.fn.executable("deno") == 1,
build = "deno task --quiet build:fast",
ft = md_like,
config = function()
require("peek").setup()
vim.api.nvim_create_user_command("PeekOpen", require("peek").open, {})
vim.api.nvim_create_user_command("PeekClose", require("peek").close, {})
end,
opts = {},
},
{
"iamcco/markdown-preview.nvim",
event = { "VeryLazy" },
cond = vim.fn.executable("deno") == 0,
build = function()
vim.fn["mkdp#util#install"]()
end,
version = false,
ft = md_like,
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
},
{
"chomosuke/typst-preview.nvim",
ft = { "typst" },
opts = { -- to use mason-managed binary
dependencies_bin = { ["tinymist"] = "tinymist" },
},
cmd = {
"TypstPreview",
"TypstPreviewUpdate",
"TypstPreviewStop",
"TypstPreviewToggle",
"TypstPreviewFollowCursor",
"TypstPreviewNoFollowCursor",
"TypstPreviewFollowCursorToggle",
},
},
--- END PREVIEW SECTION
-- easy copy paste of images into markup files
{
@ -145,7 +159,7 @@ local prose_plugs = {
},
cmd = { "PasteImage" },
keys = {
{ "<leader>pi", "<cmd>PasteImage<cr>", desc = "Paste image from system clipboard" },
{ "<localleader>pi", "<cmd>PasteImage<cr>", desc = "Paste image from system clipboard" },
},
ft = prose_ft,
},
@ -244,22 +258,25 @@ local prose_plugs = {
-- cite as you write from papis databases
-- ADDITIONAL DEPENDENCIES: papis and yq in shell env
-- {
-- "jghauser/papis.nvim",
-- dependencies = {
-- "kkharji/sqlite.lua",
-- "MunifTanjim/nui.nvim",
-- "pysan3/pathlib.nvim",
-- "nvim-neotest/nvim-nio",
-- "nvim-treesitter/nvim-treesitter",
-- },
-- cond = vim.fn.executable("papis") == 1 and vim.fn.executable("yq") == 1,
-- ft = writing_ft,
-- lazy = false,
-- config = function()
-- require("papis").setup({})
-- end,
-- },
-- still same issues: slow, buggy, does not work for me
{
"jghauser/papis.nvim",
dependencies = {
"kkharji/sqlite.lua",
"MunifTanjim/nui.nvim",
"pysan3/pathlib.nvim",
"nvim-neotest/nvim-nio",
-- if not already installed, you may also want:
{ "nvim-telescope/telescope.nvim", optional = true },
-- "hrsh7th/nvim-cmp",
},
config = function()
require("papis").setup({
init_filetypes = prose_ft,
})
end,
lazy = false,
},
{
"barreiroleo/ltex_extra.nvim",
branch = "dev",