From c9301fd3450653d0c3741c7e26e98847573bb48c Mon Sep 17 00:00:00 2001 From: "iliya.saroukha" <iliya.saroukhanian@etu.hesge.ch> Date: Sun, 28 Jul 2024 23:48:59 +0200 Subject: [PATCH] feat: added peek.nvim, replacing markdown-preview --- lua/plugins/peek.lua | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 lua/plugins/peek.lua diff --git a/lua/plugins/peek.lua b/lua/plugins/peek.lua new file mode 100644 index 0000000..246ac6a --- /dev/null +++ b/lua/plugins/peek.lua @@ -0,0 +1,32 @@ +return { + "toppair/peek.nvim", + event = { "VeryLazy" }, + build = "deno task --quiet build:fast", + config = function() + -- default config: + require('peek').setup({ + auto_load = true, -- whether to automatically load preview when + -- entering another markdown buffer + close_on_bdelete = true, -- close preview window on buffer delete + + syntax = true, -- enable syntax highlighting, affects performance + + theme = 'dark', -- 'dark' or 'light' + + update_on_change = true, + + app = 'browser', -- 'webview', 'browser', string or a table of strings + -- explained below + + filetype = { 'markdown' }, -- list of filetypes to recognize as markdown + + -- relevant if update_on_change is true + throttle_at = 200000, -- start throttling when file exceeds this + -- amount of bytes in size + throttle_time = 'auto', -- minimum amount of time in milliseconds + -- that has to pass before starting new render + }) + vim.api.nvim_create_user_command("PeekOpen", require("peek").open, {}) + vim.api.nvim_create_user_command("PeekClose", require("peek").close, {}) + end, +} -- GitLab