From 6b6f5b3e57e10832fb840c9a44a2b5a6d0350cc8 Mon Sep 17 00:00:00 2001 From: Daniel Winkler Date: Mon, 27 Jul 2026 11:25:49 +1000 Subject: [PATCH] vimtex is not lua --- plugin/28_latex.lua | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/plugin/28_latex.lua b/plugin/28_latex.lua index b77b201..3b24f9e 100644 --- a/plugin/28_latex.lua +++ b/plugin/28_latex.lua @@ -11,24 +11,19 @@ later(function() return end + -- vimtex is a VimL plugin: it does not expose a Lua module. Configure it + -- via globals before loading so the plugin picks them up on startup. + vim.g.vimtex_compiler_method = "latexmk" + vim.g.vimtex_compiler_latexmk = { + -- Keep conservative defaults: no continuous background compilation and no + -- callback chatter. Manual :VimtexCompile still works on demand. + continuous = 0, + callback = 0, + } + -- Let vimtex choose the first available viewer (zathura, Skim, Evince, ...). + Config.add("vimtex") - local ok, vimtex = pcall(require, "vimtex") - if not ok then - vim.notify("vimtex not available", vim.log.levels.WARN) - return - end - - -- Keep conservative defaults: latexmk continuous compilation off, single - -- viewer (zathura falls back to Evince on most setups). - vimtex.setup({ - enabled = true, - compile_on_save = false, - compiler = "latexmk", - -- Avoid hooking spell/formatting into our global group; - -- vimtex stashes its own mappings automatically. - }) - -- Filetype detection is normally on, but force it explicitly so .tex files -- opened outside Quarto still pick up the LSP + viewer hooks. vim.api.nvim_create_autocmd("BufReadPost", {