Skip to content

Commit

Permalink
yazi: update shell integrations and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
XYenon committed Nov 25, 2023
1 parent 8cedd63 commit a462e73
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions modules/programs/yazi.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ let
function ya
set tmp (mktemp -t "yazi-cwd.XXXXX")
yazi --cwd-file="$tmp"
if set cwd (cat -- "$tmp") && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
cd -- "$cwd"
end
rm -f -- "$tmp"
end
'';

nushellIntegration = ''
def-env ya [] {
let tmp = (mktemp -t "yazi-cwd.XXXXX")
def --env ya [] {
let tmp = $"($env.TEMP)(char path_sep)yazi-cwd." + (random chars -l 5)
yazi --cwd-file $tmp
let cwd = (cat -- $tmp)
let cwd = (open $tmp)
if $cwd != "" and $cwd != $env.PWD {
cd $cwd
}
Expand Down Expand Up @@ -82,7 +82,7 @@ in {
Configuration written to
{file}`$XDG_CONFIG_HOME/yazi/keymap.toml`.
See <https://github.com/sxyazi/yazi/blob/main/config/docs/keymap.md>
See <https://yazi-rs.github.io/docs/configuration/keymap>
for the full list of options.
'';
};
Expand All @@ -107,7 +107,7 @@ in {
Configuration written to
{file}`$XDG_CONFIG_HOME/yazi/yazi.toml`.
See <https://github.com/sxyazi/yazi/blob/main/config/docs/yazi.md>
See <https://yazi-rs.github.io/docs/configuration/yazi>
for the full list of options.
'';
};
Expand All @@ -131,7 +131,7 @@ in {
Configuration written to
{file}`$XDG_CONFIG_HOME/yazi/theme.toml`.
See <https://github.com/sxyazi/yazi/blob/main/config/docs/theme.md>
See <https://yazi-rs.github.io/docs/configuration/theme>
for the full list of options
'';
};
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/programs/yazi/fish-integration-enabled.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let
function ya
set tmp (mktemp -t "yazi-cwd.XXXXX")
yazi --cwd-file="$tmp"
if set cwd (cat -- "$tmp") && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
cd -- "$cwd"
end
rm -f -- "$tmp"
Expand Down
6 changes: 3 additions & 3 deletions tests/modules/programs/yazi/nushell-integration-enabled.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

let
shellIntegration = ''
def-env ya [] {
let tmp = (mktemp -t "yazi-cwd.XXXXX")
def --env ya [] {
let tmp = $"($env.TEMP)(char path_sep)yazi-cwd." + (random chars -l 5)
yazi --cwd-file $tmp
let cwd = (cat -- $tmp)
let cwd = (open $tmp)
if $cwd != "" and $cwd != $env.PWD {
cd $cwd
}
Expand Down

0 comments on commit a462e73

Please sign in to comment.