summaryrefslogtreecommitdiff
path: root/ftplugin
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2024-09-08 01:28:22 -0400
committerBenjamin Chausse <benjamin@chausse.xyz>2024-09-08 01:28:22 -0400
commitfea8c12adb35076cc6bae11cc345f0270ec45110 (patch)
treeed2ec226fe93513ad41616346fc7199fa6450076 /ftplugin
parent167b84d94a0ea1986ae391ccfba162b382b0d33b (diff)
parent9973585a15e2769ebc8dfe81e7c35c5965064171 (diff)
Merge branch 'master' of github.com:ChausseBenjamin/neovim-confHEADmaster
Diffstat (limited to 'ftplugin')
-rw-r--r--ftplugin/tex.lua7
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()