mirror of
https://github.com/Theaninova/TheaninovOS.git
synced 2026-01-22 01:22:44 +00:00
refactor: restructure
This commit is contained in:
34
modules/home-manager/modules/nixvim/undotree.nix
Normal file
34
modules/home-manager/modules/nixvim/undotree.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
cfg = config.presets.undotree;
|
||||
in
|
||||
{
|
||||
options.presets.undotree = {
|
||||
enable = lib.mkEnableOption "Undotree";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
opts = {
|
||||
undodir.__raw = # lua
|
||||
"os.getenv('HOME') .. '/.config/nvim/undodir'";
|
||||
undofile = true;
|
||||
};
|
||||
keymaps = [
|
||||
{
|
||||
key = "<leader>u";
|
||||
mode = "n";
|
||||
action = "<cmd>:UndotreeToggle<CR>";
|
||||
}
|
||||
];
|
||||
plugins = {
|
||||
undotree.enable = true;
|
||||
which-key.settings.spec = [
|
||||
{
|
||||
__unkeyed-1 = "<leader>u";
|
||||
desc = "Undotree";
|
||||
icon = "";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user