1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-03-28 05:57:45 +01:00

nvim: autostart knap for tex and markdown

This commit is contained in:
tiyn 2024-01-02 23:54:51 +01:00
parent 1506e2c559
commit c53e936f73
2 changed files with 17 additions and 3 deletions

View File

@ -1,11 +1,16 @@
vim.api.nvim_create_autocmd({ 'BufEnter' },
{
callback = function() vim.o.foldenable = false end
callback = function()
vim.o.foldenable = false
require("knap").toggle_autopreviewing()
end
})
vim.api.nvim_create_autocmd({ 'VimLeave' },
{
callback = function() os.execute('mdclear ' .. vim.fn.expand('%')) end
callback = function()
os.execute('mdclear ' .. vim.fn.expand('%'))
end
})
vim.o.shiftwidth = 2

View File

@ -1,6 +1,15 @@
vim.api.nvim_create_autocmd({ 'BufEnter' },
{
callback = function()
require("knap").toggle_autopreviewing()
end
})
vim.api.nvim_create_autocmd({ 'VimLeave' },
{
callback = function() os.execute('texclear ' .. vim.fn.expand('%')) end
callback = function()
os.execute('texclear ' .. vim.fn.expand('%'))
end
})
vim.o.shiftwidth = 2