yazi: improve fish integration
Calls yazi as `command yazi`, allowing to use "yazi" as `shellWrapperName`. Also defines the wrapper with `programs.fish.functions` instead of `interactiveShellInit`.
This commit is contained in:
parent
96dee79b17
commit
4481a16d1a
4 changed files with 32 additions and 22 deletions
|
|
@ -18,14 +18,12 @@ let
|
|||
'';
|
||||
|
||||
fishIntegration = ''
|
||||
function ${cfg.shellWrapperName}
|
||||
set tmp (mktemp -t "yazi-cwd.XXXXX")
|
||||
yazi $argv --cwd-file="$tmp"
|
||||
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
|
||||
builtin cd -- "$cwd"
|
||||
end
|
||||
rm -f -- "$tmp"
|
||||
set -l tmp (mktemp -t "yazi-cwd.XXXXX")
|
||||
command yazi $argv --cwd-file="$tmp"
|
||||
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
|
||||
builtin cd -- "$cwd"
|
||||
end
|
||||
rm -f -- "$tmp"
|
||||
'';
|
||||
|
||||
nushellIntegration = ''
|
||||
|
|
@ -202,7 +200,7 @@ in {
|
|||
|
||||
programs.zsh.initExtra = mkIf cfg.enableZshIntegration bashIntegration;
|
||||
|
||||
programs.fish.interactiveShellInit =
|
||||
programs.fish.functions.${cfg.shellWrapperName} =
|
||||
mkIf cfg.enableFishIntegration fishIntegration;
|
||||
|
||||
programs.nushell.extraConfig =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue