init
This commit is contained in:
commit
6eae514dab
15 changed files with 500 additions and 0 deletions
61
plugins/lsp.nix
Normal file
61
plugins/lsp.nix
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
{...}: {
|
||||
vim = {
|
||||
lsp.enable = true;
|
||||
|
||||
languages = {
|
||||
enableFormat = true;
|
||||
enableTreesitter = true;
|
||||
enableExtraDiagnostics = true;
|
||||
|
||||
python = {
|
||||
enable = true;
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = ["ty"];
|
||||
};
|
||||
format = {
|
||||
enable = true;
|
||||
type = ["black"];
|
||||
};
|
||||
};
|
||||
|
||||
lua = {
|
||||
enable = true;
|
||||
lsp.enable = true;
|
||||
format.enable = true;
|
||||
};
|
||||
|
||||
rust = {
|
||||
enable = true;
|
||||
lsp.enable = true;
|
||||
extensions.crates-nvim.enable = true;
|
||||
format.enable = true;
|
||||
};
|
||||
|
||||
nix = {
|
||||
enable = true;
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = ["nil"];
|
||||
};
|
||||
format = {
|
||||
enable = true;
|
||||
type = ["alejandra"];
|
||||
};
|
||||
};
|
||||
|
||||
clang = {
|
||||
enable = true;
|
||||
lsp.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{key = "<leader>ls"; mode = ["n"]; action = "<cmd>FzfLua lsp_document_symbols<cr>"; desc = "Document Symbols";}
|
||||
{key = "<leader>lS"; mode = ["n"]; action = "<cmd>FzfLua lsp_live_workspace_symbols<cr>"; desc = "Workspace Symbols";}
|
||||
{key = "<leader>la"; mode = ["n"]; lua = true; action = "function() vim.lsp.buf.code_action() end"; desc = "Code Actions";}
|
||||
{key = "K"; mode = ["n"]; lua = true; action = "function() vim.lsp.buf.hover() end"; desc = "Hover Docs";}
|
||||
{key = "<leader>lR"; mode = ["n"]; action = "<cmd>LspRestart<CR>"; desc = "Restart LSP";}
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue