mirror of
https://github.com/nix-community/home-manager
synced 2024-12-24 18:59:47 +01:00
yazi: update shell integrations (#5048)
This commit is contained in:
parent
380a878c27
commit
28e90a978e
4 changed files with 9 additions and 17 deletions
|
@ -8,7 +8,7 @@ let
|
|||
|
||||
bashIntegration = ''
|
||||
function ya() {
|
||||
tmp="$(mktemp -t "yazi-cwd.XXXXX")"
|
||||
local tmp="$(mktemp -t "yazi-cwd.XXXXX")"
|
||||
yazi "$@" --cwd-file="$tmp"
|
||||
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
||||
cd -- "$cwd"
|
||||
|
@ -29,18 +29,14 @@ let
|
|||
'';
|
||||
|
||||
nushellIntegration = ''
|
||||
def --env ya [args?] {
|
||||
def --env ya [...args] {
|
||||
let tmp = (mktemp -t "yazi-cwd.XXXXX")
|
||||
if ($args == null) {
|
||||
yazi --cwd-file $tmp
|
||||
} else {
|
||||
yazi $args --cwd-file $tmp
|
||||
}
|
||||
yazi ...$args --cwd-file $tmp
|
||||
let cwd = (open $tmp)
|
||||
if $cwd != "" and $cwd != $env.PWD {
|
||||
cd $cwd
|
||||
}
|
||||
rm -f $tmp
|
||||
rm -fp $tmp
|
||||
}
|
||||
'';
|
||||
in {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
let
|
||||
shellIntegration = ''
|
||||
function ya() {
|
||||
tmp="$(mktemp -t "yazi-cwd.XXXXX")"
|
||||
local tmp="$(mktemp -t "yazi-cwd.XXXXX")"
|
||||
yazi "$@" --cwd-file="$tmp"
|
||||
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
||||
cd -- "$cwd"
|
||||
|
|
|
@ -2,18 +2,14 @@
|
|||
|
||||
let
|
||||
shellIntegration = ''
|
||||
def --env ya [args?] {
|
||||
def --env ya [...args] {
|
||||
let tmp = (mktemp -t "yazi-cwd.XXXXX")
|
||||
if ($args == null) {
|
||||
yazi --cwd-file $tmp
|
||||
} else {
|
||||
yazi $args --cwd-file $tmp
|
||||
}
|
||||
yazi ...$args --cwd-file $tmp
|
||||
let cwd = (open $tmp)
|
||||
if $cwd != "" and $cwd != $env.PWD {
|
||||
cd $cwd
|
||||
}
|
||||
rm -f $tmp
|
||||
rm -fp $tmp
|
||||
}
|
||||
'';
|
||||
in {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
let
|
||||
shellIntegration = ''
|
||||
function ya() {
|
||||
tmp="$(mktemp -t "yazi-cwd.XXXXX")"
|
||||
local tmp="$(mktemp -t "yazi-cwd.XXXXX")"
|
||||
yazi "$@" --cwd-file="$tmp"
|
||||
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
||||
cd -- "$cwd"
|
||||
|
|
Loading…
Reference in a new issue