addet yazi 'y' function
This commit is contained in:
parent
2ef1ba0f33
commit
24ec2d6925
1 changed files with 172 additions and 164 deletions
10
.zshrc
10
.zshrc
|
@ -119,7 +119,7 @@ HISTDUP=erase
|
|||
# Completion styling
|
||||
zstyle :compinstall filename "$HOME/.zshrc"
|
||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
||||
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
|
||||
# zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
|
||||
zstyle ':completion:*' menu no
|
||||
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
|
||||
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath'
|
||||
|
@ -218,6 +218,14 @@ _alias(){
|
|||
if command_exists yazi; then
|
||||
echo_info "yazi is the explorer of choise"
|
||||
alias lf="yazi || ya pack -i"
|
||||
function y() {
|
||||
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
|
||||
yazi "$@" --cwd-file="$tmp"
|
||||
if cwd="$(command cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
||||
builtin cd -- "$cwd"
|
||||
fi
|
||||
rm -f -- "$tmp"
|
||||
}
|
||||
elif command_exists ranger; then
|
||||
echo_info "ranger is the explorer of choise"
|
||||
alias lf="ranger"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue