-
Notifications
You must be signed in to change notification settings - Fork 3
/
lsp.nix
89 lines (85 loc) · 1.99 KB
/
lsp.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{
lib,
pkgs,
...
}: {
programs.nixvim.plugins = {
nvim-jdtls = {
enable = true;
data = "~/.cache/jdtls/workspace";
cmd = [
"${lib.getExe pkgs.jdt-language-server}"
];
};
lsp = {
enable = true;
preConfig =
/*
lua
*/
''
local lsp_symbol = function(name, icon)
vim.fn.sign_define(
"DiagnosticSign" .. name,
{ text = icon, numhl = "Diagnostic" .. name, texthl = "Diagnostic" .. name }
)
end
lsp_symbol("Error", "")
lsp_symbol("Info", "")
lsp_symbol("Hint", "")
lsp_symbol("Warn", "")
'';
servers = {
bashls.enable = true;
cssls.enable = true;
html.enable = true;
# rust-analyzer should not be set here because of rustaceanvim
nil_ls = {
enable = true;
settings = {
formatting.command = [(lib.getExe pkgs.alejandra) "--quiet"];
};
};
nixd.enable = true;
};
#keymaps = {
# diagnostic = {
# "<leader>k" = "goto_prev";
# "<leader>j" = "goto_next";
# };
# lspBuf = {
# "gd" = "definition";
# "gD" = "references";
# "<leader>lt" = "type_definition";
# "gi" = "implementation";
# "K" = "hover";
# "<leader>k" = "hover";
# "<leader>r" = "rename";
# };
#};
};
none-ls = {
enable = true;
sources = {
diagnostics = {
deadnix.enable = true;
gitlint.enable = true;
protolint.enable = true;
};
formatting = {
alejandra.enable = true;
markdownlint.enable = true;
sqlfluff.enable = true;
shfmt.enable = true;
};
};
};
dap = {
enable = true;
extensions = {
dap-virtual-text.enable = true;
dap-ui.enable = true;
};
};
};
}