This commit is contained in:
meml0rz
2024-11-13 00:39:17 +01:00
parent f9765b9a21
commit a722790b06
3 changed files with 188 additions and 63 deletions

View File

@ -26,8 +26,10 @@ in
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<C-e>" = "cmp.mapping.close()";
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})";
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})";
#"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})";
#"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})";
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
"<CR>" = "cmp.mapping.confirm({ select = false, behavior = cmp.ConfirmBehavior.Replace })";
};

View File

@ -1,66 +1,123 @@
{ config, pkgs, nixvim, ... }:
{
programs.nixvim.plugins = {
rustaceanvim = {
enable = true;
settings = {
server = {
cmd = [
"rustup"
"run"
"nightly"
"rust-analyzer"
];
default_settings = {
rust-analyzer = {
check = {
command = "clippy";
};
inlayHints = {
lifetimeElisionHints = {
enable = "always";
};
};
};
};
standalone = false;
};
programs.nixvim.plugins = {
lsp-format = {
enable = true;
};
lsp = {
enable = true;
inlayHints = true;
servers = {
html = {
enable = true;
};
lua_ls = {
enable = true;
};
# nil-ls = {
# enable = true;
# };
nixd = {
enable = true;
extraOptions = {
nixos = {
expr = "(builtins.getFlake \"/etc/nixos\").nixosConfigurations.aurelionite.options";
};
home_manager = {
expr = "(builtins.getFlake \"/etc/nixos\").homeConfigurations.aurelionite.options";
};
};
};
lsp = {
enable = true;
servers = {
asm_lsp = {
enable = true;
autostart = true;
};
clangd = {
enable = true;
autostart = true;
};
gopls = {
enable = true;
autostart = true;
};
lua_ls = {
enable = true;
autostart = true;
};
nixd = {
enable = true;
autostart = true;
};
pyright = {
enable = true;
autostart = true;
};
rust_analyzer = {
enable = false;
autostart = true;
installCargo = true;
installRustc = true;
};
};
marksman = {
enable = true;
};
};
pyright = {
enable = true;
};
gopls = {
enable = true;
};
terraformls = {
enable = true;
};
yamlls = {
enable = true;
};
};
keymaps = {
silent = true;
lspBuf = {
gd = {
action = "definition";
desc = "Goto Definition";
};
gr = {
action = "references";
desc = "Goto References";
};
gD = {
action = "declaration";
desc = "Goto Declaration";
};
gI = {
action = "implementation";
desc = "Goto Implementation";
};
gT = {
action = "type_definition";
desc = "Type Definition";
};
# Use LSP saga keybinding instead
# K = {
# action = "hover";
# desc = "Hover";
# };
# "<leader>cw" = {
# action = "workspace_symbol";
# desc = "Workspace Symbol";
# };
"<leader>cr" = {
action = "rename";
desc = "Rename";
};
};
# diagnostic = {
# "<leader>cd" = {
# action = "open_float";
# desc = "Line Diagnostics";
# };
# "[d" = {
# action = "goto_next";
# desc = "Next Diagnostic";
# };
# "]d" = {
# action = "goto_prev";
# desc = "Previous Diagnostic";
# };
# };
};
};
};
extraConfigLua = ''
local _border = "rounded"
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
vim.lsp.handlers.hover, {
border = _border
}
)
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
vim.lsp.handlers.signature_help, {
border = _border
}
)
vim.diagnostic.config{
float={border=_border}
};
require('lspconfig.ui.windows').default_options = {
border = _border
}
'';
}

View File

@ -0,0 +1,66 @@
{ config, pkgs, nixvim, ... }:
{
programs.nixvim.plugins = {
rustaceanvim = {
enable = true;
settings = {
server = {
cmd = [
"rustup"
"run"
"nightly"
"rust-analyzer"
];
default_settings = {
rust-analyzer = {
check = {
command = "clippy";
};
inlayHints = {
lifetimeElisionHints = {
enable = "always";
};
};
};
};
standalone = false;
};
};
};
lsp = {
enable = true;
servers = {
asm_lsp = {
enable = true;
autostart = true;
};
clangd = {
enable = true;
autostart = true;
};
gopls = {
enable = true;
autostart = true;
};
lua_ls = {
enable = true;
autostart = true;
};
nixd = {
enable = true;
autostart = true;
};
pyright = {
enable = true;
autostart = true;
};
rust_analyzer = {
enable = false;
autostart = true;
installCargo = true;
installRustc = true;
};
};
};
};
}