nvim: use knap for markdown aswell

master
tiyn 1 year ago
parent 46c3f34aa5
commit b48e634554

@ -7,5 +7,5 @@ vim.o.shiftwidth = 2
vim.o.softtabstop = 2
vim.o.textwidth = 100
-- iamcco/markdown-preview.nvim
vim.keymap.set('n', '<leader>p', ':MarkdownPreviewToggle<CR>', { noremap = true })
-- frabjous/knap
vim.keymap.set('n', '<leader>p', require("knap").toggle_autopreviewing, { noremap = true })

@ -8,3 +8,4 @@ vim.o.softtabstop = 2
-- frabjous/knap
vim.keymap.set('n', '<leader>p', require("knap").toggle_autopreviewing, { noremap = true })
vim.keymap.set({ 'n', 'v', 'i' },'<F7>', function() require("knap").forward_jump() end)

@ -6,7 +6,6 @@ vim.keymap.set('i', '<F3>', '<NOP>', { noremap = true })
vim.keymap.set('i', '<F4>', '<NOP>', { noremap = true })
vim.keymap.set('i', '<F5>', '<NOP>', { noremap = true })
vim.keymap.set('i', '<F6>', '<NOP>', { noremap = true })
vim.keymap.set({ 'n', 'i' }, '<F7>', '<NOP>', { noremap = true })
vim.keymap.set('i', '<F8>', '<NOP>', { noremap = true })
vim.keymap.set({ 'n', 'i' }, '<F9>', '<NOP>', { noremap = true })
vim.keymap.set({ 'n', 'i' }, '<F10>', '<NOP>', { noremap = true })

@ -5,12 +5,18 @@ return {
ft = { 'tex' },
config = function()
vim.g.knap_settings = {
-- tex
texoutputext = "pdf",
textopdf = "pdflatex -synctex=1 -halt-on-error -interaction=batchmode %docroot%",
textopdfviewerlaunch =
"zathura --synctex-editor-command 'nvim --headless -es --cmd \"lua require('\"'\"'knaphelper'\"'\"').relayjump('\"'\"'%servername%'\"'\"','\"'\"'%{input}'\"'\"',%{line},0)\"' %outputfile%",
textopdfviewerrefresh = "none",
textopdfforwardjump = "zathura --synctex-forward=%line%:%column%:%srcfile% %outputfile%"
textopdfforwardjump = "zathura --synctex-forward=%line%:%column%:%srcfile% %outputfile%",
-- markdown
mdoutputext = "pdf",
mdtopdf = "pandoc %docroot% -o %outputfile%",
mdtopdfviewerlaunch = "zathura %outputfile%",
mdtopdfviewerrefresh = "none",
}
end
}

@ -1,16 +0,0 @@
return {
-- preview for markdown filetypes
{
"iamcco/markdown-preview.nvim",
ft = { 'markdown' },
build = "cd app && yarn install",
config = function()
vim.cmd([[
function OpenMarkdownPreview (url)
execute "silent ! firefox --kiosk --new-window " . a:url
endfunction
]])
vim.g.mkdp_browserfunc = "OpenMarkdownPreview"
end
}
}
Loading…
Cancel
Save