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
nvim/.config/nvim/lua/plugins

View file

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

View file

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