From 32dbb0b103b5bccef4b9ab736742354ee9454241 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Mon, 22 May 2023 16:32:06 -0500 Subject: [PATCH] feat(nvim|zathura): better latex integration --- dots/.config/nvim/lua/plugins/configs/lsp.lua | 18 +++++++++++++++++- dots/.config/nvim/lua/plugins/plugins.lua | 16 +++++++++++++--- dots/.config/zathura/zathurarc | 3 +++ 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/dots/.config/nvim/lua/plugins/configs/lsp.lua b/dots/.config/nvim/lua/plugins/configs/lsp.lua index eae24b12..be954fc5 100755 --- a/dots/.config/nvim/lua/plugins/configs/lsp.lua +++ b/dots/.config/nvim/lua/plugins/configs/lsp.lua @@ -275,6 +275,23 @@ lspconfig.azure_pipelines_ls.setup({ on_attach = on_attach, }) +lspconfig.texlab.setup({ + settings = { + texlab = { + build = { + onSave = true, + executable = "tectonic", + forwardSearchAfter = true, + args = { "-X", "compile", "%f", "--synctex" }, + }, + forwardSearch = { + executable = "zathura", + args = { "--synctex-forward", "%l:1:%f", "%p" }, + }, + }, + }, +}) + local path = vim.fn.stdpath("config") .. "/spell/en.utf-8.add" local words = {} @@ -315,7 +332,6 @@ for _, server in ipairs({ "tsserver", "rnix", "marksman", - "texlab", }) do lspconfig[server].setup(opts) end diff --git a/dots/.config/nvim/lua/plugins/plugins.lua b/dots/.config/nvim/lua/plugins/plugins.lua index 38878354..b848eec3 100755 --- a/dots/.config/nvim/lua/plugins/plugins.lua +++ b/dots/.config/nvim/lua/plugins/plugins.lua @@ -590,12 +590,22 @@ lazy.setup({ "gaoDean/autolist.nvim", ft = { "markdown", - "tex", "text", + "tex", "plaintex", - "norg", }, - opts = {}, + config = function() + local autolist = require("autolist") + autolist.setup() + autolist.create_mapping_hook("i", "", autolist.new) + autolist.create_mapping_hook("i", "", autolist.indent) + autolist.create_mapping_hook("i", "", autolist.indent, "") + autolist.create_mapping_hook("n", "o", autolist.new) + autolist.create_mapping_hook("n", "O", autolist.new_before) + autolist.create_mapping_hook("n", ">>", autolist.indent) + autolist.create_mapping_hook("n", "<<", autolist.indent) + autolist.create_mapping_hook("n", "", autolist.force_recalculate) + end, }, -- Tint inactive windows diff --git a/dots/.config/zathura/zathurarc b/dots/.config/zathura/zathurarc index 1e82c5c4..baba0ddf 100644 --- a/dots/.config/zathura/zathurarc +++ b/dots/.config/zathura/zathurarc @@ -38,3 +38,6 @@ set recolor "true" set recolor-keephue "true" set database "plain" + +set synctex true +set synctex-editor-command "code -g %{input}:%{line}"