Skip to content

Commit

Permalink
perf(texlab): support preview
Browse files Browse the repository at this point in the history
  • Loading branch information
liubang committed Mar 5, 2023
1 parent 32f5a7f commit 4d935f2
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lua/plugins/lsp/servers/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ for _, server in ipairs {
"clangd",
"gopls",
"rust",
"texlab",
"lua_ls",
"tsserver",
"null-ls",
Expand All @@ -35,7 +36,6 @@ for _, server in ipairs {
"pyright",
"bashls",
"cmake",
"texlab",
"vimls",
"lemminx", -- for xml
} do
Expand Down
46 changes: 46 additions & 0 deletions lua/plugins/lsp/servers/texlab.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
--=====================================================================
--
-- texlab.lua -
--
-- Created by liubang on 2023/03/05 13:18
-- Last Modified: 2023/03/05 13:18
--
--=====================================================================

local c = require "plugins.lsp.customs"
local M = {}

M.setup = function()
require("lspconfig").texlab.setup(c.default {
settings = {
texlab = {
rootDirectory = nil,
build = {
executable = "latexmk",
args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" },
onSave = true,
forwardSearchAfter = false,
},
auxDirectory = ".",
forwardSearch = {
executable = "zathura",
args = { "--synctex-forward", "%l:1:%f", "%p" },
},
chktex = {
onOpenAndSave = false,
onEdit = false,
},
diagnosticsDelay = 300,
latexFormatter = "latexindent",
latexindent = {
["local"] = nil, -- local is a reserved keyword
modifyLineBreaks = false,
},
bibtexFormatter = "texlab",
formatterLineLength = 80,
},
},
})
end

return M

0 comments on commit 4d935f2

Please sign in to comment.