nvim/lua/plugins/configs/lspconfig.lua
Dane Sabo 43d6abad48 Split markdown_and_tex into per-language modules; add cadquery autorun
- Split lua/custom/language_specific_commands/markdown_and_tex.lua into
  markdown.lua, tex.lua, and a shared nabla_setup.lua
- Add cadquery.lua: auto-render on save for ~/Documents/cad scripts via
  the project venv, with notifications and a <leader>cr manual trigger
- tex.lua: add \textcolor{blue|red|green}{...} operator + visual maps
  (<leader>t{b,r,g}, <leader>tx to remove); set textwidth=80, spell on
- markdown.lua: spell on, textwidth=60, nabla setup hook
- vimtex: switch to latexmk + lualatex with continuous compile and
  synctex; PDF viewer = skim with sync/activate
- lspconfig: enable julia_ls and texlab; add julialsp + texlab to Mason
  ensure_installed
- chadrc: theme -> ayu_dark
- init.lua: ghcup PATH to macOS location; load cadquery module;
  comment out taskwarrior (replaced by openclaw agent); add updatetime
  and sessionoptions for CursorHold + auto-session
2026-05-20 10:59:08 -04:00

69 lines
1.7 KiB
Lua

dofile(vim.g.base46_cache .. "lsp")
require "nvchad.lsp"
local M = {}
local utils = require "core.utils"
-- export on_attach & capabilities for custom lspconfigs
M.on_attach = function(client, bufnr)
utils.load_mappings("lspconfig", { buffer = bufnr })
if client.server_capabilities.signatureHelpProvider then
require("nvchad.signature").setup(client)
end
end
-- disable semantic tokens
M.on_init = function(client, _)
if not utils.load_config().ui.lsp_semantic_tokens and client.supports_method "textDocument/semanticTokens" then
client.server_capabilities.semanticTokensProvider = nil
end
end
M.capabilities = vim.lsp.protocol.make_client_capabilities()
M.capabilities.textDocument.completion.completionItem = {
documentationFormat = { "markdown", "plaintext" },
snippetSupport = true,
preselectSupport = true,
insertReplaceSupport = true,
labelDetailsSupport = true,
deprecatedSupport = true,
commitCharactersSupport = true,
tagSupport = { valueSet = { 1 } },
resolveSupport = {
properties = {
"documentation",
"detail",
"additionalTextEdits",
},
},
}
vim.lsp.config("lua_ls", {
on_init = M.on_init,
on_attach = M.on_attach,
capabilities = M.capabilities,
settings = {
Lua = {
diagnostics = {
globals = { "vim" },
},
workspace = {
library = {
[vim.fn.expand "$VIMRUNTIME/lua"] = true,
[vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
[vim.fn.stdpath "data" .. "/lazy/ui/nvchad_types"] = true,
[vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy"] = true,
},
maxPreload = 100000,
preloadFileSize = 10000,
},
},
},
})
vim.lsp.enable("lua_ls")
return M