From 6d17635b31e2bf3af0f1f03284249daafe9be62f Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Sat, 10 Jul 2021 00:15:33 -0400 Subject: refactor tex to use ftplugin only --- ftplugin/tex.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'ftplugin/tex.lua') diff --git a/ftplugin/tex.lua b/ftplugin/tex.lua index 7ad35000..87f7c598 100644 --- a/ftplugin/tex.lua +++ b/ftplugin/tex.lua @@ -6,3 +6,29 @@ 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 + +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 +) -- cgit v1.2.3