1
Fork 0

Improved nix setup

This commit is contained in:
prescientmoon 2024-07-28 20:01:45 +02:00
parent a6293a1ba4
commit afea4bacd0
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4
6 changed files with 1635 additions and 1483 deletions
home/features/neovim/plugins

View file

@ -1,4 +1,3 @@
---@diagnostic disable: missing-fields
local M = {}
-- {{{ Capabilities
@ -15,91 +14,9 @@ M.capabilities = function()
end
-- }}}
-- {{{ Main config function
function M.config()
function M.config(servers)
local lspconfig = require("lspconfig")
-- {{{ General server config
---@type lspconfig.options
local servers = {
-- {{{ Typescript
tsserver = {
on_attach = function(client)
-- We handle formatting using null-ls and prettierd
client.server_capabilities.documentFormattingProvider = false
end,
},
-- }}}
-- {{{ Purescript
purescriptls = {
root_dir = lspconfig.util.root_pattern("spago.yaml"),
settings = {
purescript = {
censorWarnings = {
"UnusedName",
"ShadowedName",
"UserDefinedWarning",
},
formatter = "purs-tidy",
},
},
},
-- }}}
-- {{{ Lua
lua_ls = {
settings = {
Lua = {
format = {
enable = true,
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
},
},
},
-- }}}
-- {{{ Latex
texlab = {
settings = {
texlab = {
build = {
args = {
-- Here by default:
"-pdf",
"-interaction=nonstopmode",
"-synctex=1",
"%f",
-- Required for syntax highlighting inside the generated pdf apparently
"-shell-escape",
},
executable = "latexmk",
forwardSearchAfter = true,
onSave = true,
},
chktex = {
onOpenAndSave = true,
onEdit = true,
},
},
},
},
-- }}}
-- {{{ Nix
nil_ls = {},
nixd = {},
-- }}}
cssls = {},
jsonls = {},
dhall_lsp_server = {},
typst_lsp = {
exportPdf = "onType",
},
elmls = {},
csharp_ls = {},
}
-- }}}
local capabilities = M.capabilities()
for lsp, details in pairs(servers) do
details.capabilities = capabilities