2024-08-06 16:35:29 +02:00
|
|
|
-- Install and configure Pandoc plugins: vim-pandoc, vim-pandoc-syntax
|
|
|
|
|
|
|
|
-- Sets the pandoc formatting mode to hardwrap
|
2024-10-10 14:40:45 +02:00
|
|
|
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 ]])
|
2024-08-06 16:35:29 +02:00
|
|
|
|
|
|
|
-- Keymaps to switch to soft or hardwarp, or to toggle.
|
|
|
|
vim.keymap.set(
|
2024-08-13 07:29:57 +02:00
|
|
|
'n',
|
|
|
|
'<leader>sw',
|
|
|
|
'<cmd>call pandoc#formatting#UseSoftWraps()<CR>',
|
|
|
|
{desc = "[vim-pandoc] Switch to softwrap"}
|
2024-08-06 16:35:29 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
vim.keymap.set(
|
2024-08-13 07:29:57 +02:00
|
|
|
'n',
|
|
|
|
'<leader>hw',
|
|
|
|
'<cmd>call pandoc#formatting#UseHardWraps()<CR>',
|
|
|
|
{desc = "[vim-pandoc] Switch to hardwrap"}
|
2024-08-06 16:35:29 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
vim.keymap.set('n',
|
|
|
|
'<leader>tw',
|
|
|
|
'<cmd>call pandoc#formatting#ToggleAutoformat()<CR>',
|
2024-08-13 07:29:57 +02:00
|
|
|
{desc = "[vim-pandoc] Toggle autoformat, to deactivate it"}
|
2024-08-06 16:35:29 +02:00
|
|
|
)
|
|
|
|
|
2024-08-20 16:22:51 +02:00
|
|
|
vim.keymap.set(
|
|
|
|
"n",
|
|
|
|
"<leader>tc",
|
|
|
|
"<cmd>TOC<cr>",
|
|
|
|
{ desc = "[vim-pandoc] Display the Table of Content"}
|
|
|
|
)
|
|
|
|
|
2024-08-06 16:35:29 +02:00
|
|
|
return {
|
|
|
|
{
|
|
|
|
"vim-pandoc/vim-pandoc",
|
|
|
|
ft = {
|
|
|
|
'markdown',
|
2024-10-10 14:40:45 +02:00
|
|
|
'pandoc'
|
2024-08-06 16:35:29 +02:00
|
|
|
},
|
|
|
|
lazy = true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"vim-pandoc/vim-pandoc-syntax",
|
|
|
|
ft = {
|
|
|
|
'markdown',
|
2024-10-10 14:40:45 +02:00
|
|
|
'pandoc'
|
2024-08-06 16:35:29 +02:00
|
|
|
},
|
|
|
|
lazy = true,
|
|
|
|
},
|
|
|
|
}
|