feat: replace headlines

This commit is contained in:
Folke Lemaitre 2024-07-23 07:23:05 +02:00
parent 335a298a77
commit 1bb76fc7ec
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 7 additions and 56 deletions

View file

@ -92,31 +92,13 @@ 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 },
heading = { sign = false },
},
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,
},
}

View file

@ -1,31 +0,0 @@
return {
{
"lukas-reineke/headlines.nvim",
enabled = false,
},
{
"MeanderingProgrammer/markdown.nvim",
name = "render-markdown",
dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.icons" },
event = "LazyFile",
keys = {
{ "<leader>um", "<cmd>RenderMarkdown toggle<CR>", desc = "Toggle Markdown Render" },
},
opts = {
code = {
sign = false,
},
heading = {
sign = false,
backgrounds = {
"Headline1",
"Headline2",
"Headline3",
"Headline4",
"Headline5",
"Headline6",
},
},
},
},
}