From a097fa4c04e6db34bb409e0dea302c20629da8ec Mon Sep 17 00:00:00 2001 From: Christian Chiarulli Date: Tue, 13 Jul 2021 21:13:55 -0400 Subject: LunarVim 0.4.8 (#919) --- ftplugin/tex.lua | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'ftplugin/tex.lua') diff --git a/ftplugin/tex.lua b/ftplugin/tex.lua index 7ad35000..c5748189 100644 --- a/ftplugin/tex.lua +++ b/ftplugin/tex.lua @@ -6,3 +6,33 @@ require("lspconfig").texlab.setup { cmd = { DATA_PATH .. "/lspinstall/latex/texlab" }, on_attach = require("lsp").common_on_attach, } + +vim.g.vimtex_compiler_method = "latexmk" +vim.g.vimtex_view_method = "zathura" +vim.g.vimtex_fold_enabled = 0 +vim.g.vimtex_quickfix_ignore_filters = O.lang.latex.ignore_errors + +O.plugin.which_key.mappings["L"] = { + name = "+Latex", + c = { "VimtexCompile", "Toggle Compilation Mode" }, + f = { "call vimtex#fzf#run()", "Fzf Find" }, + i = { "VimtexInfo", "Project Information" }, + s = { "VimtexStop", "Stop Project Compilation" }, + t = { "VimtexTocToggle", "Toggle Table Of Content" }, + v = { "VimtexView", "View PDF" }, +} + +-- Compile on initialization, cleanup on quit +vim.api.nvim_exec( + [[ + augroup vimtex_event_1 + au! + au User VimtexEventQuit call vimtex#compiler#clean(0) + au User VimtexEventInitPost call vimtex#compiler#compile() + augroup END + ]], + false +) +if O.lang.latex.auto_save then + vim.api.nvim_exec([[au FocusLost * :wa]], false) +end -- cgit v1.2.3