From 264abdf9d52fe44c1dcb66f0502dcba5a881ea43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Guimar=C3=A3es?= Date: Tue, 23 Jul 2024 23:02:56 -0700 Subject: [PATCH] feat(markdown): replace `headlines.nvim` by `markdown.nvim` (#4139) Okay, so https://github.com/MeanderingProgrammer/markdown.nvim?tab=readme-ov-file is a new kid on the block that I've been enjoying a lot. It replaces headlines.nvim. This new extra is a way for folks to try markdown.nvim effortlessly. (Should I add here everything from the current markdown extra to make this extra a complete drop-in replacement?) --------- Co-authored-by: Folke Lemaitre --- NEWS.md | 3 ++ lua/lazyvim/plugins/extras/lang/markdown.lua | 39 +++++++------------- 2 files changed, 17 insertions(+), 25 deletions(-) diff --git a/NEWS.md b/NEWS.md index 1abf2ec8..20b6156b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,9 @@ ## 12.x +- **Markdown Extra**: [headlines.nvim](https://github.com/lukas-reineke/headlines.nvim) has been removed in favor of [markdown.nvim](https://github.com/MeanderingProgrammer/markdown.nvim) + to spice up your markdown files. + - [nvim-spectre](https://github.com/nvim-pack/nvim-spectre) has been removed in favor of [grug-far.nvim](https://github.com/MagicDuck/grug-far.nvim). **grug-far.nvim** has a great UI and feels more intuitive to use. diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index 7d026b23..2257d73e 100644 --- a/lua/lazyvim/plugins/extras/lang/markdown.lua +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -92,31 +92,20 @@ return { }, { - "lukas-reineke/headlines.nvim", - opts = function() - local opts = {} - for _, ft in ipairs({ "markdown", "norg", "rmd", "org" }) do - opts[ft] = { - headline_highlights = {}, - -- disable bullets for now. See https://github.com/lukas-reineke/headlines.nvim/issues/66 - bullets = {}, - quote_string = false, - } - for i = 1, 6 do - local hl = "Headline" .. i - vim.api.nvim_set_hl(0, hl, { link = "Headline", default = true }) - table.insert(opts[ft].headline_highlights, hl) - end - end - return opts - end, + "MeanderingProgrammer/markdown.nvim", + opts = { + file_types = { "markdown", "norg", "rmd", "org" }, + code = { + sign = false, + width = "block", + right_pad = 1, + }, + heading = { + sign = false, + icons = {}, + }, + }, ft = { "markdown", "norg", "rmd", "org" }, - config = function(_, opts) - -- PERF: schedule to prevent headlines slowing down opening a file - vim.schedule(function() - require("headlines").setup(opts) - require("headlines").refresh() - end) - end, + enabled = true, }, }