This commit is contained in:
catvayor 2024-11-28 15:44:53 +01:00
parent 6ddf07aa20
commit aff8a0aca3
Signed by: lbailly
GPG key ID: CE3E645251AC63F3
3 changed files with 108 additions and 12 deletions

View file

@ -95,16 +95,18 @@ let
which-key = { which-key = {
enable = true; enable = true;
settings.triggers = settings.triggers =
[ map
{ (key: {
__unkeyed-1 = "<leader>"; __unkeyed = key;
mode = "nxsot"; mode = "nxsot";
} })
{ [
__unkeyed-1 = "f"; "<leader>"
mode = "nxsot"; "f"
} "c"
]; "d"
"y"
];
}; };
todo-comments = { todo-comments = {
@ -158,6 +160,96 @@ let
} }
]; ];
luasnip.enable = true;
cmp_luasnip.enable = true;
cmp-nvim-lsp.enable = true;
cmp-buffer.enable = true;
cmp-cmdline.enable = true;
cmp-path.enable = true;
cmp-latex-symbols.enable = true;
cmp = {
enable = true;
autoEnableSources = false;
cmdline =
let
slash-qu = {
mapping.__raw = "cmp.mapping.preset.cmdline()";
sources = [
{ name = "buffer"; }
];
};
in
{
"/" = slash-qu;
"?" = slash-qu;
":" = {
mapping.__raw = "cmp.mapping.preset.cmdline()";
sources = [
{ name = "path"; }
{ name = "cmdline"; }
];
matching = {
disallow_symbol_nonprefix_matching = false;
};
};
};
settings = {
snippet.expand = ''
function(args)
require('luasnip').lsp_expand(args.body)
end
'';
sources = map (name: { inherit name; }) [
"luasnip"
"nvim_lsp"
"buffer"
] ++ [
{ name = "latex_symbols"; option.strategy = 2; }
];
mapping = {
"<C-Space>" = "cmp.mapping.complete()";
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-e>" = "cmp.mapping.close()";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })";
"<S-Tab>" = ''
cmp.mapping(
function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif require("luasnip").jumpable(-1) then
vim.fn.feedkeys(
vim.api.nvim_replace_termcodes(
"<Plug>luasnip-jump-prev",
true, true, true),
"")
else
fallback()
end
end,
{'i', 's'})'';
"<Tab>" = ''
cmp.mapping(
function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
vim.fn.feedkeys(
vim.api.nvim_replace_termcodes(
"<Plug>luasnip-expand-or-jump",
true, true, true),
"")
else
fallback()
end
end,
{ 'i', 's' })
'';
};
};
};
lsp-lines.enable = true; lsp-lines.enable = true;
lsp = { lsp = {
@ -201,6 +293,10 @@ let
installCargo = true; installCargo = true;
installRustc = true; installRustc = true;
}; };
hls = {
enable = true;
installGhc = true;
};
}; };
}; };
}; };

View file

@ -10,7 +10,7 @@
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
users.catvayor users.catvayor
# ./router.nix ./router.nix
]; ];
fileSystems."/tmp" = { fileSystems."/tmp" = {

View file

@ -1,5 +1,5 @@
{ { lib, ... }: {
boot.kernel.sysctl."net.ipv4.ip_forward" = true; boot.kernel.sysctl."net.ipv4.ip_forward" = lib.mkForce true;
systemd.network = { systemd.network = {
enable = true; enable = true;