From 5ee4c41721fce584aaaf1b9d243078db472937ea Mon Sep 17 00:00:00 2001 From: antoine Date: Sat, 18 Apr 2026 10:06:01 +0200 Subject: [PATCH] feat: replace alpha, lazygit-nvim, dressing with snacks.nvim --- config.nix | 1 + plugins/editing.nix | 3 --- plugins/git.nix | 17 +---------------- plugins/snacks.nix | 31 +++++++++++++++++++++++++++++++ plugins/ui.nix | 17 ----------------- 5 files changed, 33 insertions(+), 36 deletions(-) create mode 100644 plugins/snacks.nix diff --git a/config.nix b/config.nix index fe6b0cd..e606821 100644 --- a/config.nix +++ b/config.nix @@ -12,5 +12,6 @@ ./plugins/editing.nix ./plugins/keymaps.nix ./plugins/claude-code.nix + ./plugins/snacks.nix ]; } diff --git a/plugins/editing.nix b/plugins/editing.nix index 4d98452..c416a0f 100644 --- a/plugins/editing.nix +++ b/plugins/editing.nix @@ -19,9 +19,6 @@ package = inc-rename-nvim; setup = ''require("inc_rename").setup({})''; }; - dressing-nvim = { - package = dressing-nvim; - }; }; keymaps = [ diff --git a/plugins/git.nix b/plugins/git.nix index 5abfaf0..8526dd6 100644 --- a/plugins/git.nix +++ b/plugins/git.nix @@ -1,21 +1,6 @@ -{pkgs, ...}: { +{...}: { vim.git = { gitsigns.enable = true; vim-fugitive.enable = true; }; - - vim.extraPlugins = with pkgs.vimPlugins; { - lazygit-nvim = { - package = lazygit-nvim; - }; - }; - - vim.keymaps = [ - { - key = "gg"; - mode = ["n"]; - action = "LazyGit"; - desc = "LazyGit"; - } - ]; } diff --git a/plugins/snacks.nix b/plugins/snacks.nix new file mode 100644 index 0000000..e316619 --- /dev/null +++ b/plugins/snacks.nix @@ -0,0 +1,31 @@ +{...}: { + vim.utility.snacks-nvim = { + enable = true; + setupOpts = { + input.enable = true; + lazygit.enable = true; + rename.enable = true; + + dashboard = { + enable = true; + sections = [ + {section = "header";} + {section = "keys"; gap = 1; padding = 1;} + {section = "startup";} + ]; + preset.keys = [ + {icon = " "; key = "e"; action = ":ene | startinsert"; desc = "New file";} + {icon = " "; key = ",ff"; action = ":FzfLua files"; desc = "Find file";} + {icon = " "; key = ",fo"; action = ":FzfLua oldfiles"; desc = "Recently opened";} + {icon = " "; key = ",fg"; action = ":FzfLua live_grep"; desc = "Find word";} + {icon = " "; key = ",fp"; action = ":SessionManager load_session"; desc = "Open session";} + {icon = " "; key = "q"; action = ":qa"; desc = "Quit";} + ]; + }; + }; + }; + + vim.keymaps = [ + {key = "gg"; mode = ["n"]; lua = true; action = "function() Snacks.lazygit() end"; desc = "LazyGit";} + ]; +} diff --git a/plugins/ui.nix b/plugins/ui.nix index 6d8d214..cebc981 100644 --- a/plugins/ui.nix +++ b/plugins/ui.nix @@ -33,22 +33,5 @@ }; }; - dashboard.alpha = { - enable = true; - theme = "dashboard"; - }; - - luaConfigRC.alpha-buttons = '' - local dashboard = require("alpha.themes.dashboard") - dashboard.section.buttons.val = { - dashboard.button("e", " New file", ":ene startinsert"), - dashboard.button(",ff", " Find file", ":FzfLua files"), - dashboard.button(",fo", " Recently opened", ":FzfLua oldfiles"), - dashboard.button(",fg", " Find word", ":FzfLua live_grep"), - dashboard.button(",fp", " Open session", ":SessionManager load_session"), - dashboard.button("q", " Quit", ":qa"), - } - require("alpha").setup(dashboard.config) - ''; }; }