2023-09-22 13:00:16 +02:00
|
|
|
{ ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
shellIntegration = ''
|
|
|
|
function ya
|
|
|
|
set tmp (mktemp -t "yazi-cwd.XXXXX")
|
2023-12-16 00:07:57 +01:00
|
|
|
yazi $argv --cwd-file="$tmp"
|
2023-11-25 09:17:54 +01:00
|
|
|
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
|
2024-05-27 23:50:57 +02:00
|
|
|
builtin cd -- "$cwd"
|
2023-09-22 13:00:16 +02: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}'
|
|
|
|
'';
|
|
|
|
}
|