diff options
author | Benjamin Chausse <benjamin@chausse.xyz> | 2024-09-08 01:28:22 -0400 |
---|---|---|
committer | Benjamin Chausse <benjamin@chausse.xyz> | 2024-09-08 01:28:22 -0400 |
commit | fea8c12adb35076cc6bae11cc345f0270ec45110 (patch) | |
tree | ed2ec226fe93513ad41616346fc7199fa6450076 /ftplugin | |
parent | 167b84d94a0ea1986ae391ccfba162b382b0d33b (diff) | |
parent | 9973585a15e2769ebc8dfe81e7c35c5965064171 (diff) |
Diffstat (limited to 'ftplugin')
-rw-r--r-- | ftplugin/tex.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ftplugin/tex.lua b/ftplugin/tex.lua index b565c48..5df3dd9 100644 --- a/ftplugin/tex.lua +++ b/ftplugin/tex.lua @@ -1,2 +1,7 @@ -- Configure the compiler for latex -vim.opt_local.makeprg = 'pdflatex -interaction=nonstopmode -file-line-error -synctex=1 %' + +local function tex_root() + return vim.fn.system('grep -rl -m 1 --include "*.tex" "documentclass"') +end + +vim.opt_local.makeprg = "pdflatex -interaction=nonstopmode -file-line-error -synctex=1 " .. tex_root() |