plugins: folds .md frontmatter and code blocks
- Folds the frontmatter YAML and fenced code blocks in markdown file. - Removes unneccessary filetype for lazy loading markdown plugins. - Moves a markdownpreview settings that was wrongfully placed in the pandoc plugin configuration. - Lazy loads mkdnflow plugin for quarto filetype. Co-Authored-by: iGor milhit <igor@milhit.ch>main
parent
cf209d6e52
commit
bd142e38b1
|
@ -3,7 +3,5 @@
|
|||
-- See :h awa
|
||||
|
||||
vim.opt.awa=true
|
||||
-- vim.opt.foldmethod = "expr"
|
||||
-- vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
vim.opt.foldlevel = 1
|
||||
vim.opt.conceallevel = 2
|
||||
-- vim.opt.foldlevel = 1
|
||||
-- vim.opt.conceallevel = 2
|
||||
|
|
|
@ -2,13 +2,15 @@
|
|||
-- https://github.com/iamcco/markdown-preview.nvim
|
||||
-- https://github.com/iamcco/markdown-preview.nvim/issues/558#issuecomment-1514701537
|
||||
|
||||
-- Defines the filetypes that should be recognize by markdown-preview.
|
||||
vim.cmd([[ let g:mkdp_filetypes = ['markdown', 'pandoc',] ]])
|
||||
|
||||
return {
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
ft = {
|
||||
'pandoc',
|
||||
'markdown',
|
||||
'pandoc.markdown'
|
||||
},
|
||||
lazy = true,
|
||||
build = "cd app && npm install && git reset --hard",
|
||||
|
|
|
@ -17,7 +17,7 @@ return {
|
|||
ft = {
|
||||
'pandoc',
|
||||
'markdown',
|
||||
'pandoc.markdown',
|
||||
'quarto'
|
||||
},
|
||||
lazy = true,
|
||||
config = function ()
|
||||
|
|
|
@ -1,12 +1,18 @@
|
|||
-- Install and configure Pandoc plugins: vim-pandoc, vim-pandoc-syntax
|
||||
|
||||
-- Defines the filetypes that should be recognize by vim-pandoc. Allows
|
||||
-- mardown-preview to be available with pandoc filetype.
|
||||
vim.cmd([[ let g:mkdp_filetypes = ['markdown', 'pandoc', 'pandoc.markdown'] ]])
|
||||
|
||||
-- Sets the pandoc formatting mode to hardwrap
|
||||
vim.cmd([[ let g:pandoc#formatting#mode = "hA" ]])
|
||||
|
||||
-- Pandoc folding settings
|
||||
-- Fold level 2 headings
|
||||
vim.cmd([[ let g:pandoc#folding#level=1 ]])
|
||||
-- Enable YAML folding
|
||||
vim.cmd([[ let g:pandoc#folding#fold_yaml=1 ]])
|
||||
-- Fold the entire frontmatter
|
||||
vim.cmd([[ let g:pandoc#folding#foldlevel_yaml=2 ]])
|
||||
-- Fold fenced code blocks
|
||||
vim.cmd([[ let g:pandoc#folding#fold_fenced_codeblocks=1 ]])
|
||||
|
||||
-- Keymaps to switch to soft or hardwarp, or to toggle.
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
|
@ -40,8 +46,7 @@ return {
|
|||
"vim-pandoc/vim-pandoc",
|
||||
ft = {
|
||||
'markdown',
|
||||
'pandoc',
|
||||
'pandoc.markdown'
|
||||
'pandoc'
|
||||
},
|
||||
lazy = true,
|
||||
},
|
||||
|
@ -49,8 +54,7 @@ return {
|
|||
"vim-pandoc/vim-pandoc-syntax",
|
||||
ft = {
|
||||
'markdown',
|
||||
'pandoc',
|
||||
'pandoc.markdown'
|
||||
'pandoc'
|
||||
},
|
||||
lazy = true,
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue