diff options
-rw-r--r-- | nvim/.config/nvim/lua/tobyvin/lsp/configs.lua | 210 |
1 files changed, 106 insertions, 104 deletions
diff --git a/nvim/.config/nvim/lua/tobyvin/lsp/configs.lua b/nvim/.config/nvim/lua/tobyvin/lsp/configs.lua index 876df34..7fdf036 100644 --- a/nvim/.config/nvim/lua/tobyvin/lsp/configs.lua +++ b/nvim/.config/nvim/lua/tobyvin/lsp/configs.lua @@ -8,133 +8,135 @@ local M = { stylelint_lsp = {}, clangd = {}, pylsp = {}, -} - -M.jsonls = { - settings = { - json = { - format = { - enable = true, + perlnavigator = { + settings = { + perlnavigator = { + enableWarnings = false, }, - validate = { enable = true }, }, }, -} - -M.gopls = { - cmd = { "gopls", "serve" }, - settings = { - gopls = { - analyses = { - unusedparams = true, + jsonls = { + settings = { + json = { + format = { + enable = true, + }, + validate = { enable = true }, }, - staticcheck = true, }, }, -} - -M.rust_analyzer = { - standalone = true, - settings = { - ["rust-analyzer"] = { - cargo = { - features = "all", - }, - check = { - command = "clippy", - }, - completion = { - postfix = { - enable = false, + gopls = { + cmd = { "gopls", "serve" }, + settings = { + gopls = { + analyses = { + unusedparams = true, }, + staticcheck = true, }, - imports = { - granularity = { - enforce = true, + }, + }, + rust_analyzer = { + standalone = true, + settings = { + ["rust-analyzer"] = { + cargo = { + features = "all", + }, + check = { + command = "clippy", + }, + completion = { + postfix = { + enable = false, + }, + }, + imports = { + granularity = { + enforce = true, + }, }, }, }, }, -} - -M.sumneko_lua = { - settings = { - Lua = { - workspace = { - checkThirdParty = false, - }, - completion = { - callSnippet = "Replace", - }, - diagnostics = { - globals = { "vim" }, - }, - format = { - enable = false, + sumneko_lua = { + settings = { + Lua = { + workspace = { + checkThirdParty = false, + }, + completion = { + callSnippet = "Replace", + }, + diagnostics = { + globals = { "vim" }, + }, + format = { + enable = false, + }, }, }, }, -} - -M.texlab = { - settings = { - texlab = { - rootDirectory = ".", - build = { - args = { - "-pdf", - "-interaction=nonstopmode", - "-synctex=1", - "-auxdir=../build", - "-outdir=../build", - "-emulate-aux-dir", - "%f", + texlab = { + settings = { + texlab = { + rootDirectory = ".", + build = { + args = { + "-pdf", + "-interaction=nonstopmode", + "-synctex=1", + "-auxdir=../build", + "-outdir=../build", + "-emulate-aux-dir", + "%f", + }, + onSave = true, }, - onSave = true, - }, - forwardSearch = { - executable = "zathura", - args = { - "--synctex-editor-command", - [[nvim-texlabconfig -file '%{input}' -line %{line}]], - "--synctex-forward", - "%l:1:%f", - "%p", + forwardSearch = { + executable = "zathura", + args = { + "--synctex-editor-command", + [[nvim-texlabconfig -file '%{input}' -line %{line}]], + "--synctex-forward", + "%l:1:%f", + "%p", + }, + }, + chktex = { + onEdit = true, + onOpenAndSave = true, + }, + auxDirectory = "../build", + latexindent = { + ["local"] = string.format("%s/latexindent/indentconfig.yaml", vim.env.XDG_CONFIG_HOME), + modifyLineBreaks = true, }, - }, - chktex = { - onEdit = true, - onOpenAndSave = true, - }, - auxDirectory = "../build", - latexindent = { - ["local"] = string.format("%s/latexindent/indentconfig.yaml", vim.env.XDG_CONFIG_HOME), - modifyLineBreaks = true, }, }, - }, - on_attach = function(_, bufnr) - vim.b[bufnr].tex_flavor = "latex" - vim.wo.spell = true + on_attach = function(_, bufnr) + vim.b[bufnr].tex_flavor = "latex" + vim.wo.spell = true - local preview_autocmd - local augroup = vim.api.nvim_create_augroup("texlab", {}) + local preview_autocmd + local augroup = vim.api.nvim_create_augroup("texlab", {}) - vim.api.nvim_create_user_command("TexlabPreview", function() - preview_autocmd = vim.api.nvim_create_autocmd("CursorMoved", { - group = augroup, - command = "TexlabForward", - }) + vim.api.nvim_create_user_command("TexlabPreview", function() + preview_autocmd = vim.api.nvim_create_autocmd("CursorMoved", { + group = augroup, + command = "TexlabForward", + }) - vim.cmd.TexlabForward() - end, { desc = "Texlab preview start" }) + vim.cmd.TexlabForward() + end, { desc = "Texlab preview start" }) - vim.api.nvim_create_user_command("TexlabPreviewStop", function() - if preview_autocmd then - vim.api.nvim_del_autocmd(preview_autocmd) - end - end, { desc = "Texlab preview stop" }) - end, + vim.api.nvim_create_user_command("TexlabPreviewStop", function() + if preview_autocmd then + vim.api.nvim_del_autocmd(preview_autocmd) + end + end, { desc = "Texlab preview stop" }) + end, + }, } return M |