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 <folke.lemaitre@gmail.com>
This commit is contained in:
George Guimarães 2024-07-23 23:02:56 -07:00 committed by GitHub
parent 489a7a8e84
commit 264abdf9d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 25 deletions

View file

@ -2,6 +2,9 @@
## 12.x ## 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). - [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. **grug-far.nvim** has a great UI and feels more intuitive to use.

View file

@ -92,31 +92,20 @@ return {
}, },
{ {
"lukas-reineke/headlines.nvim", "MeanderingProgrammer/markdown.nvim",
opts = function() opts = {
local opts = {} file_types = { "markdown", "norg", "rmd", "org" },
for _, ft in ipairs({ "markdown", "norg", "rmd", "org" }) do code = {
opts[ft] = { sign = false,
headline_highlights = {}, width = "block",
-- disable bullets for now. See https://github.com/lukas-reineke/headlines.nvim/issues/66 right_pad = 1,
bullets = {}, },
quote_string = false, heading = {
} sign = false,
for i = 1, 6 do icons = {},
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,
ft = { "markdown", "norg", "rmd", "org" }, ft = { "markdown", "norg", "rmd", "org" },
config = function(_, opts) enabled = true,
-- PERF: schedule to prevent headlines slowing down opening a file
vim.schedule(function()
require("headlines").setup(opts)
require("headlines").refresh()
end)
end,
}, },
} }