nixos-config/home-manager/modules/nvf/utils.nix
2026-01-04 10:27:19 -05:00

149 lines
3.2 KiB
Nix

{
lib,
pkgs,
...
}:
{
programs.nvf.settings.vim = {
undoFile.enable = true;
# theme = lib.mkForce {
# enable = true;
# name = "catppuccin";
# style = "latte";
# transparent = false;
# };
navigation = {
harpoon.enable = true;
};
utility = {
motion.flash-nvim.enable = true;
outline.aerial-nvim.enable = true;
diffview-nvim.enable = true;
surround.enable = true;
smart-splits.enable = true;
yanky-nvim.enable = true;
};
tabline.nvimBufferline.enable = true;
notes.todo-comments.enable = true;
# assistant.copilot = {
# enable = true;
# cmp.enable = true;
# };
statusline.lualine.enable = true;
autocomplete = {
nvim-cmp = {
enable = true;
sources = {
buffer = "[Buffer]";
nvim-cmp = null;
path = "[Path]";
};
sourcePlugins = [
pkgs.vimPlugins.cmp-cmdline
];
};
};
snippets.luasnip.enable = true;
snippets.luasnip.customSnippets.snipmate = {
all = [
{
trigger = "if";
body = "if $1 else $2";
}
];
nix = [
{
trigger = "mkOption";
body = ''
mkOption {
type = $1;
default = $2;
description = $3;
example = $4;
}
'';
}
];
haskell = [
{
trigger = "zzis";
body = ''
insert :: (Ord a) => a -> [a] -> [a]
insert x [] = [x]
insert x (y:ys)
| x <= y = x : y : ys
| otherwise = y : insert x ys
insertionSort :: (Ord a) => [a] -> [a]
insertionSort [] = []
insertionSort (x:xs) = insert x (insertionSort xs)
'';
}
{
trigger = "zzso";
body = ''
sortOn :: Ord b => (a -> b) -> [a] -> [a]
sortOn f = foldr insert []
where
insert x [] = [x]
insert x (y:ys)
| f x <= f y = x : y : ys
| otherwise = y : insert x ys
'';
}
];
};
ui = {
noice.enable = true;
colorizer.enable = true;
};
visuals = {
rainbow-delimiters.enable = true;
nvim-scrollbar = {
enable = false;
};
};
git = {
enable = true;
gitsigns.enable = true;
};
terminal.toggleterm = {
enable = true;
lazygit = {
enable = true;
mappings.open = "<leader>gl";
};
};
formatter.conform-nvim.enable = true;
binds.hardtime-nvim.enable = true;
utility.motion.precognition.enable = true;
binds.hardtime-nvim.setupOpts = {
max_count = 3; # Optional: limit of consecutive presses
disabled_keys = {
"<Up>" = false;
"<Down>" = false;
"<Left>" = false;
"<Right>" = false;
};
restricted_keys = {
"<Up>" = [
"n"
"x"
];
"<Down>" = [
"n"
"x"
];
"<Left>" = [
"n"
"x"
];
"<Right>" = [
"n"
"x"
];
};
};
};
}