2024-08-06 16:35:29 +02:00
|
|
|
-- Install and configure Pandoc plugins: vim-pandoc, vim-pandoc-syntax
|
2023-05-30 20:55:59 +02:00
|
|
|
|
2024-08-06 16:35:29 +02:00
|
|
|
-- Defines the filetypes that should be recognize by vim-pandoc. Allows
|
|
|
|
-- mardown-preview to be available with pandoc filetype.
|
2023-05-30 20:55:59 +02:00
|
|
|
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" ]])
|
|
|
|
|
|
|
|
-- Keymaps to switch to soft or hardwarp, or to toggle.
|
|
|
|
vim.keymap.set('n', '<leader>sw', '<cmd>call pandoc#formatting#UseSoftWraps()<CR>', {desc = 'Switch to softwrap'})
|
|
|
|
vim.keymap.set('n', '<leader>hw', '<cmd>call pandoc#formatting#UseHardWraps()<CR>', {desc = 'Switch to hardwrap'})
|
|
|
|
vim.keymap.set('n', '<leader>tw', '<cmd>call pandoc#formatting#ToggleAutoformat()<CR>', {desc = 'Toggle autoformat, to deactivate it'})
|
|
|
|
|
|
|
|
return {
|
|
|
|
{
|
|
|
|
"vim-pandoc/vim-pandoc",
|
|
|
|
ft = "pandoc",
|
|
|
|
lazy = true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"vim-pandoc/vim-pandoc-syntax",
|
|
|
|
ft = "pandoc",
|
|
|
|
lazy = true,
|
|
|
|
},
|
|
|
|
}
|