59 lines
1.2 KiB
Lua
59 lines
1.2 KiB
Lua
-- 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" ]])
|
|
|
|
-- Keymaps to switch to soft or hardwarp, or to toggle.
|
|
vim.keymap.set(
|
|
'n',
|
|
'<leader>sw',
|
|
'<cmd>call pandoc#formatting#UseSoftWraps()<CR>',
|
|
{desc = "[vim-pandoc] Switch to softwrap"}
|
|
)
|
|
|
|
vim.keymap.set(
|
|
'n',
|
|
'<leader>hw',
|
|
'<cmd>call pandoc#formatting#UseHardWraps()<CR>',
|
|
{desc = "[vim-pandoc] Switch to hardwrap"}
|
|
)
|
|
|
|
vim.keymap.set('n',
|
|
'<leader>tw',
|
|
'<cmd>call pandoc#formatting#ToggleAutoformat()<CR>',
|
|
{desc = "[vim-pandoc] Toggle autoformat, to deactivate it"}
|
|
)
|
|
|
|
vim.keymap.set(
|
|
"n",
|
|
"<leader>tc",
|
|
"<cmd>TOC<cr>",
|
|
{ desc = "[vim-pandoc] Display the Table of Content"}
|
|
)
|
|
|
|
return {
|
|
{
|
|
"vim-pandoc/vim-pandoc",
|
|
ft = {
|
|
"markdown",
|
|
"pandoc",
|
|
"pandoc.markdown",
|
|
"quarto",
|
|
},
|
|
lazy = true,
|
|
},
|
|
{
|
|
"vim-pandoc/vim-pandoc-syntax",
|
|
ft = {
|
|
'markdown',
|
|
'pandoc',
|
|
'pandoc.markdown'
|
|
},
|
|
lazy = true,
|
|
},
|
|
}
|