-- Install and configure Pandoc plugins: vim-pandoc, vim-pandoc-syntax -- 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', 'sw', 'call pandoc#formatting#UseSoftWraps()', {desc = "[vim-pandoc] Switch to softwrap"} ) vim.keymap.set( 'n', 'hw', 'call pandoc#formatting#UseHardWraps()', {desc = "[vim-pandoc] Switch to hardwrap"} ) vim.keymap.set('n', 'tw', 'call pandoc#formatting#ToggleAutoformat()', {desc = "[vim-pandoc] Toggle autoformat, to deactivate it"} ) vim.keymap.set( "n", "tc", "TOC", { desc = "[vim-pandoc] Display the Table of Content"} ) return { { "vim-pandoc/vim-pandoc", ft = { 'markdown', 'pandoc' }, lazy = true, }, { "vim-pandoc/vim-pandoc-syntax", ft = { 'markdown', 'pandoc' }, lazy = true, }, }