2023-09-22 11:00:16 +00:00
|
|
|
{ ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
shellIntegration = ''
|
2024-06-23 14:05:25 +00:00
|
|
|
function yy
|
2023-09-22 11:00:16 +00:00
|
|
|
set tmp (mktemp -t "yazi-cwd.XXXXX")
|
2023-12-15 23:07:57 +00:00
|
|
|
yazi $argv --cwd-file="$tmp"
|
2023-11-25 08:17:54 +00:00
|
|
|
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
|
2024-05-27 21:50:57 +00:00
|
|
|
builtin cd -- "$cwd"
|
2023-09-22 11:00:16 +00:00
|
|
|
end
|
|
|
|
rm -f -- "$tmp"
|
|
|
|
end
|
|
|
|
'';
|
|
|
|
in {
|
|
|
|
programs.fish.enable = true;
|
|
|
|
|
|
|
|
programs.yazi = {
|
|
|
|
enable = true;
|
|
|
|
enableFishIntegration = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
test.stubs.yazi = { };
|
|
|
|
|
|
|
|
nmt.script = ''
|
|
|
|
assertFileContains home-files/.config/fish/config.fish '${shellIntegration}'
|
|
|
|
'';
|
|
|
|
}
|