Muh dotfiles
This commit is contained in:
11
.config/fish/functions/y.fish
Normal file
11
.config/fish/functions/y.fish
Normal file
@ -0,0 +1,11 @@
|
||||
function y --wraps 'yazi' --description 'TUI file manager'
|
||||
set -l tmp (mktemp -t 'yazi_cwd.XXX')
|
||||
yazi --cwd-file="$tmp" $argv
|
||||
|
||||
set -l cwd (command cat -- "$tmp")
|
||||
and test -n "$cwd"
|
||||
and test "$cwd" != "$PWD"
|
||||
and builtin cd -- "$cwd"
|
||||
|
||||
rm -f -- "$tmp"
|
||||
end
|
Reference in New Issue
Block a user