Add proper LaTeX support (finally)
This commit is contained in:
@@ -6,6 +6,7 @@ local options = {
|
|||||||
-- python = { "isort", "black" },
|
-- python = { "isort", "black" },
|
||||||
python = { "isort", "ruff_fix", "ruff_format" },
|
python = { "isort", "ruff_fix", "ruff_format" },
|
||||||
yaml = { "prettier" },
|
yaml = { "prettier" },
|
||||||
|
latex = { "bibtex-tidy", "tex-fmt", lsp_format = "fallback" }
|
||||||
},
|
},
|
||||||
|
|
||||||
-- format_on_save = {
|
-- format_on_save = {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ local lspconfig = require "lspconfig"
|
|||||||
nvlsp.defaults()
|
nvlsp.defaults()
|
||||||
|
|
||||||
-- EXAMPLE
|
-- EXAMPLE
|
||||||
local servers = { "html", "cssls", "ruff", "jedi_language_server", "yls", "lua_ls" }
|
local servers = { "html", "cssls", "ruff", "jedi_language_server", "yls", "lua_ls", "texlab" }
|
||||||
|
|
||||||
-- lsps with default config
|
-- lsps with default config
|
||||||
for _, lsp in ipairs(servers) do
|
for _, lsp in ipairs(servers) do
|
||||||
@@ -16,12 +16,41 @@ for _, lsp in ipairs(servers) do
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
-- configuring single server, example: typescript
|
-- lspconfig.texlab.setup({
|
||||||
-- lspconfig.ts_ls.setup {
|
-- settings = {
|
||||||
-- on_attach = nvlsp.on_attach,
|
-- latex = {
|
||||||
-- on_init = nvlsp.on_init,
|
-- build = {
|
||||||
-- capabilities = nvlsp.capabilities,
|
-- executable = "latexmk",
|
||||||
-- }
|
-- args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" },
|
||||||
|
-- onSave = true,
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- })
|
||||||
|
|
||||||
|
-- Set up LTeX separately
|
||||||
|
lspconfig.ltex.setup {
|
||||||
|
on_init = nvlsp.on_init,
|
||||||
|
capabilities = nvlsp.capabilities,
|
||||||
|
|
||||||
|
on_attach = function(client, bufnr)
|
||||||
|
-- Run NvChad's on_attach for your usual LSP keymaps
|
||||||
|
nvlsp.on_attach(client, bufnr)
|
||||||
|
|
||||||
|
require("ltex_extra").setup {
|
||||||
|
load_langs = { "en-GB", "nb" },
|
||||||
|
init_check = true,
|
||||||
|
path = vim.fn.expand("~/.local/share/ltex"), -- where to store language dicts
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
ltex = {
|
||||||
|
language = "en-GB",
|
||||||
|
additionalLanguages = { "nb" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
lspconfig.ruff.setup({
|
lspconfig.ruff.setup({
|
||||||
init_options = {
|
init_options = {
|
||||||
|
|||||||
@@ -103,6 +103,10 @@ return {
|
|||||||
"lua",
|
"lua",
|
||||||
"python",
|
"python",
|
||||||
"markdown",
|
"markdown",
|
||||||
|
"latex",
|
||||||
|
},
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -258,4 +262,9 @@ return {
|
|||||||
lazy = false,
|
lazy = false,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"barreiroleo/ltex-extra.nvim",
|
||||||
|
ft = { "markdown", "tex" },
|
||||||
|
dependencies = { "neovim/nvim-lspconfig" },
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user