From 6202d588b96d24d00dc3256019404df3ce987562 Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Wed, 9 Aug 2023 02:17:04 +0300 Subject: [PATCH] Fix `markdown-preview` --- lazy-lock.json | 4 ++++ lua/plugins/general.lua | 27 +++++++++++++++++++++++++++ lua/plugins/markdown-preview.lua | 20 ++++++++++++-------- 3 files changed, 43 insertions(+), 8 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 9796e69..55e698e 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -25,6 +25,7 @@ "lazy.nvim": { "branch": "main", "commit": "dac844ed617dda4f9ec85eb88e9629ad2add5e05" }, "lsp-zero.nvim": { "branch": "v2.x", "commit": "73bc33fe9ad5a1d4501536fdd4755b3aa18c3392" }, "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, + "markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "e86a4c84ff35240639643ffed56ee1c4d55f538e" }, "mason-null-ls.nvim": { "branch": "main", "commit": "ae0c5fa57468ac65617f1bf821ba0c3a1e251f0c" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "e4d56b400e9757b1dc77d620fd3069396e92d5fc" }, @@ -33,6 +34,8 @@ "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" }, "nightfly": { "branch": "master", "commit": "903da3ef1e41c6c763c9f98de6f2f9dc193ca5e7" }, "nightfox.nvim": { "branch": "main", "commit": "a48f6d9a0273101df76eb25d2f5477baa277f935" }, + "noice.nvim": { "branch": "main", "commit": "894db25ec726d32047799d4d0a982b701bec453b" }, + "nui.nvim": { "branch": "main", "commit": "9e3916e784660f55f47daa6f26053ad044db5d6a" }, "null-ls.nvim": { "branch": "main", "commit": "db09b6c691def0038c456551e4e2772186449f35" }, "nvim": { "branch": "main", "commit": "371430f32f2637d2dd5796399b3982d4cada61d8" }, "nvim-autopairs": { "branch": "master", "commit": "ae5b41ce880a6d850055e262d6dfebd362bb276e" }, @@ -41,6 +44,7 @@ "nvim-dap": { "branch": "master", "commit": "1c63f37f95cd4fb54512898168138d9a75d1516a" }, "nvim-dap-ui": { "branch": "master", "commit": "85b16ac2309d85c88577cd8ee1733ce52be8227e" }, "nvim-lspconfig": { "branch": "master", "commit": "4b1a764c10c6c8679615fcb4f1e8b0f5513d900b" }, + "nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" }, "nvim-tree.lua": { "branch": "master", "commit": "904f95cd9db31d1800998fa428e78e418a50181d" }, "nvim-treesitter": { "branch": "master", "commit": "ae88851cac32415c8239a04b7ee44d8f7625e186" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "9e519b6146512c8e2e702faf8ac48420f4f5deec" }, diff --git a/lua/plugins/general.lua b/lua/plugins/general.lua index 2ce6515..9905903 100644 --- a/lua/plugins/general.lua +++ b/lua/plugins/general.lua @@ -73,4 +73,31 @@ return { "kevinhwang91/promise-async", }, }, + + { + "folke/noice.nvim", + event = "VeryLazy", + dependencies = { + "MunifTanjim/nui.nvim", + "rcarriga/nvim-notify", + }, + opts = { + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, + }, + }, + -- you can enable a preset for easier configuration + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help + }, + }, + }, } diff --git a/lua/plugins/markdown-preview.lua b/lua/plugins/markdown-preview.lua index 70358b6..688abfd 100644 --- a/lua/plugins/markdown-preview.lua +++ b/lua/plugins/markdown-preview.lua @@ -1,10 +1,14 @@ return { - -- { - -- "iamcco/markdown-preview.nvim", - -- event = "VeryLazy", - -- build = function() - -- vim.fn["mkdp#util#install"]() - -- end, - -- opts = {}, - -- }, + { + "iamcco/markdown-preview.nvim", + build = function() + vim.fn["mkdp#util#install"]() + end, + config = function() + vim.g.mkdp_filetypes = { "markdown", "vimwiki" } + end, + opts = { + ft = { "markdown", "vimwiki" }, + }, + }, }