From 39da199c3ae69440fb81783d1ae87ce3a8cc5b5a Mon Sep 17 00:00:00 2001 From: Lucas Barbieri Date: Tue, 30 Jul 2024 16:35:30 -0300 Subject: [PATCH] feat(lang): add latex --- init.lua | 2 ++ lua/custom/plugins/none-ls.lua | 1 + lua/custom/plugins/vimtex.lua | 23 +++++++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 lua/custom/plugins/vimtex.lua diff --git a/init.lua b/init.lua index 5b500ba..849c42c 100644 --- a/init.lua +++ b/init.lua @@ -366,6 +366,8 @@ local servers = { nil_ls = {}, + texlab = {}, + jdtls = { java = { configuration = { diff --git a/lua/custom/plugins/none-ls.lua b/lua/custom/plugins/none-ls.lua index f36ae8a..d972e62 100644 --- a/lua/custom/plugins/none-ls.lua +++ b/lua/custom/plugins/none-ls.lua @@ -13,6 +13,7 @@ return { require("null-ls").builtins.diagnostics.golangci_lint, require("null-ls").builtins.formatting.google_java_format, require("null-ls").builtins.formatting.nixpkgs_fmt, + require("null-ls").builtins.formatting.textidote, } } end diff --git a/lua/custom/plugins/vimtex.lua b/lua/custom/plugins/vimtex.lua new file mode 100644 index 0000000..898f6c3 --- /dev/null +++ b/lua/custom/plugins/vimtex.lua @@ -0,0 +1,23 @@ +return { + "lervag/vimtex", + lazy = false, -- we don't want to lazy load VimTeX + -- tag = "v2.15", -- uncomment to pin to a specific release + init = function() + vim.g.vimtex_view_method = "zathura" + vim.g.vimtex_compiler_method = "tectonic" + end, + config = function() + vim.api.nvim_create_autocmd({ "Filetype" }, { + pattern = "tex", + callback = function() + vim.keymap.set("n", "cc", "VimtexCompile", { desc = "Compile latex file" }) + end + }) + vim.api.nvim_create_autocmd({ "BufWritePost" }, { + pattern = "*.tex", + callback = function() + vim.cmd [[VimtexCompile]] + end + }) + end +}