feat(neovim): install pandoc
This commit is contained in:
parent
339840a602
commit
bfa0f77296
3 changed files with 47 additions and 1 deletions
|
|
@ -1,2 +1,33 @@
|
|||
vim.o.conceallevel = 1
|
||||
vim.o.textwidth = 80
|
||||
|
||||
local buf = vim.api.nvim_get_current_buf()
|
||||
local opened = false
|
||||
|
||||
vim.api.nvim_create_autocmd('User', {
|
||||
pattern = 'RenderCompileSuccess',
|
||||
callback = function(args)
|
||||
if args.data.bufnr ~= buf then
|
||||
return
|
||||
end
|
||||
local html = args.data.output
|
||||
if not opened and html and html ~= '' then
|
||||
opened = true
|
||||
vim.system({ 'xdg-open', html })
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd('BufWritePost', {
|
||||
buffer = buf,
|
||||
callback = function()
|
||||
local ok, render = pcall(require, 'render')
|
||||
if ok then
|
||||
render.compile(buf)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.keymap.set('n', '<leader>t', function()
|
||||
require('render').compile(buf)
|
||||
end, { buffer = true })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue