nvim: Simplify prose filetype grouping

Simply have a markdown-like group and a org-like group for the plugins
that only target those specific prose modes.
This commit is contained in:
Marty Oehme 2024-09-15 22:09:58 +02:00
parent 65d5ac12ef
commit 03f18bea3a
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A

View file

@ -1,18 +1,27 @@
local md_like = {
"markdown",
"pandoc",
"quarto",
"vimwiki",
}
local org_like = {
"norg",
"org",
}
local prose_ft = {
unpack(md_like),
unpack(org_like),
"asciidoc",
"bib",
"context",
"gitcommit",
"latex",
"mail",
"markdown",
"pandoc",
"quarto",
"rst",
"tex",
"text",
"typst",
"vimwiki",
"rmd",
}
local prose_plugs = {
@ -29,7 +38,7 @@ local prose_plugs = {
"andrewferrier/wrapping.nvim",
opts = {
create_keymaps = false,
notify_on_switch = true,
notify_on_switch = false,
-- softener = { quarto = true, markdown = true, text = true, asciidoc = true },
auto_set_mode_filetype_allowlist = prose_ft,
},
@ -59,7 +68,7 @@ local prose_plugs = {
"MeanderingProgrammer/render-markdown.nvim",
main = "render-markdown",
opts = {
file_types = { "markdown", "quarto", "pandoc", "vimwiki", "norg", "rmd", "org" },
file_types = { unpack(md_like) },
code = {
sign = false,
width = "block",
@ -68,7 +77,7 @@ local prose_plugs = {
},
name = "render-markdown", -- Only needed if you have another plugin named markdown.nvim
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" }, -- if you prefer nvim-web-devicons
ft = prose_ft,
ft = md_like,
cmd = "RenderMarkdown",
keys = {
{
@ -88,6 +97,7 @@ local prose_plugs = {
event = { "VeryLazy" },
cond = vim.fn.executable("deno") == 1,
build = "deno task --quiet build:fast",
ft = md_like,
config = function()
require("peek").setup()
vim.api.nvim_create_user_command("PeekOpen", require("peek").open, {})
@ -96,11 +106,12 @@ local prose_plugs = {
},
{
"iamcco/markdown-preview.nvim",
event = { "VeryLazy" },
cond = vim.fn.executable("deno") == 0,
build = function()
vim.fn["mkdp#util#install"]()
end,
ft = prose_ft,
ft = md_like,
},
-- easy copy paste of images into markup files
@ -187,7 +198,7 @@ local prose_plugs = {
},
-- syntax highlighting for markdown criticmarkup (comments, additions, ...)
{ "vim-pandoc/vim-criticmarkup", ft = prose_ft },
{ "vim-pandoc/vim-criticmarkup", ft = md_like },
-- create mindmaps from your markdown
{