From fa2368fa6ed458b134386caa7c1d07bf7e5f565f Mon Sep 17 00:00:00 2001 From: Adam0 Date: Tue, 15 Sep 2026 15:49:13 +0200 Subject: [PATCH] Use stable Yazi search integration --- .../programs/tui/neovim/components/yazi.nix | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/modules/programs/tui/neovim/components/yazi.nix b/modules/programs/tui/neovim/components/yazi.nix index 5a8754e..33310a1 100644 --- a/modules/programs/tui/neovim/components/yazi.nix +++ b/modules/programs/tui/neovim/components/yazi.nix @@ -1,9 +1,41 @@ { - flake.modules.homeManager.neovim = {config, ...}: { + flake.modules.homeManager.neovim = { + # keep-sorted start + config, + lib, + # keep-sorted end + ... + }: let + inherit (lib.generators) mkLuaInline; + in { programs.nvf.settings.vim.utility.yazi-nvim = { enable = true; setupOpts = { + integrations.grep_in_directory = mkLuaInline '' + function(directory) + vim.defer_fn(function() + _G.telescope_pick("live_grep", { + cwd = directory, + prompt_title = "Grep in " .. directory, + search = "", + }) + end, 50) + end + ''; + + integrations.grep_in_selected_files = mkLuaInline '' + function(_, relative_paths) + vim.defer_fn(function() + _G.telescope_pick("live_grep", { + prompt_title = string.format("Grep in %d paths", #relative_paths), + search = "", + search_dirs = relative_paths, + }) + end, 50) + end + ''; + # keep-sorted start change_neovim_cwd_on_close = true; open_for_directories = true; -- 2.51.2