nvim: Add nim lsp and formatting

This commit is contained in:
Marty Oehme 2025-01-24 08:21:24 +01:00
parent 3d0a706c0c
commit 9cc3495c31
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
2 changed files with 5 additions and 1 deletions

View file

@ -13,6 +13,7 @@ local formatters = {
liquid = { "prettier" }, liquid = { "prettier" },
lua = { "stylua" }, lua = { "stylua" },
markdown = { "prettier", "injected" }, markdown = { "prettier", "injected" },
nim = { "nimpretty" },
python = { "ruff_fix", "ruff_format", "ruff_organize_imports" }, python = { "ruff_fix", "ruff_format", "ruff_organize_imports" },
quarto = { "prettier", "injected" }, quarto = { "prettier", "injected" },
sh = { "shfmt" }, sh = { "shfmt" },

View file

@ -29,6 +29,7 @@ local servers = {
}, },
}, },
marksman = {}, marksman = {},
nim_langserver = {},
basedpyright = {}, basedpyright = {},
ruff = {}, ruff = {},
serve_d = {}, serve_d = {},
@ -287,6 +288,7 @@ return {
local python_path local python_path
-- ensure python virtualenv is determined automatically on lsp start -- ensure python virtualenv is determined automatically on lsp start
-- we primarily use pyright for cmp lsp completion & hover info
lspconfig.basedpyright.setup({ lspconfig.basedpyright.setup({
on_attach = function(client, bufnr) on_attach = function(client, bufnr)
on_attach(client, bufnr) on_attach(client, bufnr)
@ -299,12 +301,13 @@ return {
client.config.settings.python.pythonPath = python_path client.config.settings.python.pythonPath = python_path
end, end,
settings = { settings = {
-- disable imports and linting since, we use ruff for that -- disable imports and linting since, using ruff for it
pyright = { pyright = {
disableOrganizeImports = true, disableOrganizeImports = true,
}, },
python = { python = {
analysis = { analysis = {
-- ignore all files, use ruff for linting
ignore = { "*" }, ignore = { "*" },
}, },
}, },