nvim: Add nim lsp and formatting
This commit is contained in:
parent
3d0a706c0c
commit
9cc3495c31
2 changed files with 5 additions and 1 deletions
|
|
@ -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" },
|
||||||
|
|
|
||||||
|
|
@ -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 = { "*" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue