mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
feat: replace headlines
This commit is contained in:
parent
335a298a77
commit
1bb76fc7ec
2 changed files with 7 additions and 56 deletions
|
|
@ -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,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue