From 49890805b0ead53b09438df1c004f5bc8d1e810f Mon Sep 17 00:00:00 2001 From: antoine Date: Sat, 18 Apr 2026 10:58:25 +0200 Subject: [PATCH] feat: replace fzf-lua with snacks.picker --- flake.nix | 2 +- plugins/lsp.nix | 4 ++-- plugins/navigation.nix | 16 ++++++---------- plugins/snacks.nix | 7 ++++--- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/flake.nix b/flake.nix index 8dd26ad..f82e19c 100644 --- a/flake.nix +++ b/flake.nix @@ -25,7 +25,7 @@ nativeBuildInputs = [pkgs.makeWrapper]; postBuild = '' wrapProgram $out/bin/nvim \ - --prefix PATH : ${pkgs.lib.makeBinPath [pkgs.git pkgs.fzf pkgs.lazygit]} + --prefix PATH : ${pkgs.lib.makeBinPath [pkgs.git pkgs.lazygit]} ''; }; }; diff --git a/plugins/lsp.nix b/plugins/lsp.nix index 5703359..f19e3a4 100644 --- a/plugins/lsp.nix +++ b/plugins/lsp.nix @@ -51,8 +51,8 @@ }; keymaps = [ - {key = "ls"; mode = ["n"]; action = "FzfLua lsp_document_symbols"; desc = "Document Symbols";} - {key = "lS"; mode = ["n"]; action = "FzfLua lsp_live_workspace_symbols"; desc = "Workspace Symbols";} + {key = "ls"; mode = ["n"]; lua = true; action = "function() Snacks.picker.lsp_symbols() end"; desc = "Document Symbols";} + {key = "lS"; mode = ["n"]; lua = true; action = "function() Snacks.picker.lsp_workspace_symbols() end"; desc = "Workspace Symbols";} {key = "la"; mode = ["n"]; lua = true; action = "function() vim.lsp.buf.code_action() end"; desc = "Code Actions";} {key = "K"; mode = ["n"]; lua = true; action = "function() vim.lsp.buf.hover() end"; desc = "Hover Docs";} {key = "lR"; mode = ["n"]; action = "LspRestart"; desc = "Restart LSP";} diff --git a/plugins/navigation.nix b/plugins/navigation.nix index e50d42f..0b36be1 100644 --- a/plugins/navigation.nix +++ b/plugins/navigation.nix @@ -7,10 +7,6 @@ }; }; - fzf-lua = { - enable = true; - profile = "telescope"; - }; session.nvim-session-manager = { enable = true; @@ -30,12 +26,12 @@ {key = "-"; mode = ["n"]; lua = true; action = ''function() MiniFiles.open() end''; desc = "Open file explorer";} {key = "-"; mode = ["n"]; lua = true; action = ''function() MiniFiles.open(vim.api.nvim_buf_get_name(0)) end''; desc = "Open file explorer (current file)";} - # FZF-lua - {key = "ff"; mode = ["n"]; action = "FzfLua files"; desc = "Find Files";} - {key = "fg"; mode = ["n"]; action = "FzfLua live_grep"; desc = "Live Grep";} - {key = "fb"; mode = ["n"]; action = "FzfLua buffers"; desc = "Buffer List";} - {key = "fh"; mode = ["n"]; action = "FzfLua help_tags"; desc = "Help Tags";} - {key = "fo"; mode = ["n"]; action = "FzfLua oldfiles"; desc = "Recent Files";} + # Snacks picker + {key = "ff"; mode = ["n"]; lua = true; action = "function() Snacks.picker.files() end"; desc = "Find Files";} + {key = "fg"; mode = ["n"]; lua = true; action = "function() Snacks.picker.grep() end"; desc = "Live Grep";} + {key = "fb"; mode = ["n"]; lua = true; action = "function() Snacks.picker.buffers() end"; desc = "Buffer List";} + {key = "fh"; mode = ["n"]; lua = true; action = "function() Snacks.picker.help() end"; desc = "Help Tags";} + {key = "fo"; mode = ["n"]; lua = true; action = "function() Snacks.picker.recent() end"; desc = "Recent Files";} {key = "fn"; mode = ["n"]; action = "Noice"; desc = "Notifications";} # Sessions diff --git a/plugins/snacks.nix b/plugins/snacks.nix index 7846e06..d66ba37 100644 --- a/plugins/snacks.nix +++ b/plugins/snacks.nix @@ -5,6 +5,7 @@ input.enable = true; lazygit.enable = true; rename.enable = true; + picker.enable = true; dashboard = { enable = true; @@ -14,9 +15,9 @@ ]; 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 = ",ff"; action = ":lua Snacks.picker.files()"; desc = "Find file";} + {icon = " "; key = ",fo"; action = ":lua Snacks.picker.recent()"; desc = "Recently opened";} + {icon = " "; key = ",fg"; action = ":lua Snacks.picker.grep()"; desc = "Find word";} {icon = " "; key = ",fp"; action = ":SessionManager load_session"; desc = "Open session";} {icon = " "; key = "q"; action = ":qa"; desc = "Quit";} ];