From a1ec4771740d321df4480e8a7224fa10b59f0569 Mon Sep 17 00:00:00 2001 From: WriterV2 Date: Fri, 3 Apr 2026 22:46:48 +0200 Subject: Update repo with git init directly in home dir --- .config/nvim/lua/writing_config.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .config/nvim/lua/writing_config.lua (limited to '.config/nvim/lua/writing_config.lua') diff --git a/.config/nvim/lua/writing_config.lua b/.config/nvim/lua/writing_config.lua new file mode 100644 index 0000000..6380868 --- /dev/null +++ b/.config/nvim/lua/writing_config.lua @@ -0,0 +1,18 @@ +vim.api.nvim_create_autocmd("BufWritePost", { + pattern = "*.tex", + callback = function() + -- compile tex file to pdf with pdflatex on save + if vim.fn.executable('pdflatex') == 1 then + vim.cmd("execute '!pdflatex ' . expand('%:p')") + else + print("pdflatex is not installed") + end + + -- compile tex file to html with pandoc on save + if vim.fn.executable('pandoc') == 1 then + vim.cmd("execute '!pandoc -o ' . substitute(expand('%:p'), '.tex', '.html ', '') . expand('%:p')") + else + print("pandoc is not installed") + end + end, +}) -- cgit v1.2.3