Redo python LSP config

This commit is contained in:
albert 2024-02-16 17:56:55 +09:00
parent 2547e2c619
commit 70de88bf6c
No known key found for this signature in database
GPG key ID: 64F6C4EB46C4543A

View file

@ -1,75 +1,80 @@
{ ... }: { { ... }: {
imports = [ ./nixvim-base.nix ]; imports = [ ./nixvim-base.nix ];
programs.nixvim = { programs.nixvim = {
plugins = { plugins = {
lsp = { lsp = {
enable = true; enable = true;
servers = { servers = {
rust-analyzer = { rust-analyzer = {
enable = true; enable = true;
installCargo = true; installCargo = true;
installRustc = true; installRustc = true;
}; };
pylsp = { pylsp = {
enable = true; enable = true;
autostart = true; autostart = true;
installLanguageServer = true; installLanguageServer = true;
settings = { settings = {
plugins = { plugins = {
black = { black = {
enabled = true; enabled = true;
preview = true; preview = true;
};
};
};
};
nil_ls.enable = true;
html.enable = true;
cssls.enable = true;
bashls.enable = true;
}; };
keymaps = { jedi_completion = {
silent = true; enabled = true;
diagnostic = { fuzzy = true;
"<leader>lk" = {
action = "goto_prev";
desc = "Go to prev";
};
"<leader>lj" = {
action = "goto_next";
desc = "Go to next";
};
};
lspBuf = {
K = {
action = "hover";
desc = "Hover";
};
"<leader>lr" = {
action = "references";
desc = "LSP [r]eferences";
};
"<leader>ld" = {
action = "definition";
desc = "LSP [d]efinitions";
};
"<leader>li" = {
action = "implementation";
desc = "LSP [i]implementations";
};
"<leader>lt" = {
action = "type_definition";
desc = "LSP [t]ype definitions";
};
"<leader>la" = {
action = "code_action";
desc = "LSP Code [A]ctions";
};
};
}; };
pylint.enabled = true;
};
}; };
};
nil_ls.enable = true;
html.enable = true;
cssls.enable = true;
bashls.enable = true;
}; };
keymaps = {
silent = true;
diagnostic = {
"<leader>lk" = {
action = "goto_prev";
desc = "Go to prev";
};
"<leader>lj" = {
action = "goto_next";
desc = "Go to next";
};
};
lspBuf = {
K = {
action = "hover";
desc = "Hover";
};
"<leader>lr" = {
action = "references";
desc = "LSP [r]eferences";
};
"<leader>ld" = {
action = "definition";
desc = "LSP [d]efinitions";
};
"<leader>li" = {
action = "implementation";
desc = "LSP [i]implementations";
};
"<leader>lt" = {
action = "type_definition";
desc = "LSP [t]ype definitions";
};
"<leader>la" = {
action = "code_action";
desc = "LSP Code [A]ctions";
};
};
};
};
}; };
};
} }