wip(plugins): add more plugins
This commit is contained in:
parent
8184b712ca
commit
1ff2f4e929
3 changed files with 359 additions and 0 deletions
114
plugins/lsp.nix
Normal file
114
plugins/lsp.nix
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
{ icons, pkgs, ... }:
|
||||
|
||||
{
|
||||
opts = {
|
||||
enable = true;
|
||||
|
||||
# Set keymaps when LSP is attached
|
||||
keymaps = {
|
||||
extra = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>li";
|
||||
action = "<cmd>LspInfo<cr>";
|
||||
options.desc = "Show LSP info";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>ll";
|
||||
action.__raw = "function() vim.lsp.codelens.refresh() end";
|
||||
options.desc = "LSP CodeLens refresh";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>lL";
|
||||
action.__raw = "function() vim.lsp.codelens.run() end";
|
||||
options.desc = "LSP CodeLens run";
|
||||
}
|
||||
];
|
||||
|
||||
lspBuf = {
|
||||
"<leader>la" = {
|
||||
action = "code_action";
|
||||
desc = "LSP code action";
|
||||
};
|
||||
|
||||
gd = {
|
||||
action = "definition";
|
||||
desc = "Go to definition";
|
||||
};
|
||||
|
||||
gI = {
|
||||
action = "implementation";
|
||||
desc = "Go to implementation";
|
||||
};
|
||||
|
||||
gy = {
|
||||
action = "type_definition";
|
||||
desc = "Go to type definition";
|
||||
};
|
||||
|
||||
K = {
|
||||
action = "hover";
|
||||
desc = "LSP hover";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
postConfig = ''
|
||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded" })
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
signs = true,
|
||||
underline = true,
|
||||
update_in_insert = true,
|
||||
severity_sort = false,
|
||||
})
|
||||
|
||||
local signs = {
|
||||
Error = "${icons.DiagnosticError}",
|
||||
Warn = "${icons.DiagnosticWarn}",
|
||||
Info = "${icons.DiagnosticInfo}",
|
||||
Hint = "${icons.DiagnosticHint}",
|
||||
}
|
||||
for type, icon in pairs(signs) do
|
||||
local hl = "DiagnosticSign" .. type
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
|
||||
end
|
||||
'';
|
||||
|
||||
# Load all servers definitions
|
||||
servers = {
|
||||
ansiblels.enable = true;
|
||||
bashls.enable = true;
|
||||
cssls.enable = true;
|
||||
docker-compose-language-service.enable = true;
|
||||
dockerls.enable = true;
|
||||
eslint.enable = true;
|
||||
gopls.enable = true;
|
||||
helm-ls.enable = true;
|
||||
html.enable = true;
|
||||
java-language-server.enable = true;
|
||||
jsonls.enable = true;
|
||||
lua-ls.enable = true;
|
||||
nginx-language-server.enable = true;
|
||||
nixd.enable = true;
|
||||
pyright.enable = true;
|
||||
sqls.enable = true;
|
||||
terraformls.enable = true;
|
||||
tsserver.enable = true;
|
||||
yamlls.enable = true;
|
||||
|
||||
typos-lsp = {
|
||||
enable = true;
|
||||
extraOptions.init_options.diagnosticSeverity = "Hint";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
rootOpts = {
|
||||
colorschemes.catppuccin.settings.integrations.native_lsp.enabled = true;
|
||||
extraPackages = [ pkgs.go ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue