From 7792d18d243c2c0afc009f4ea14a6726e96694b1 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Wed, 8 May 2024 08:42:19 +0800 Subject: [PATCH] docs: enlarge Yazi picker window --- docs/tips.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/tips.md b/docs/tips.md index 6aeb6fce7..38ab37639 100644 --- a/docs/tips.md +++ b/docs/tips.md @@ -446,19 +446,24 @@ Add a keymap to your Helix config, for example ' + y: ```toml # ~/.config/helix/config.toml [keys.normal."'"] -y = ":sh zellij run --floating -n 'Yazi picker' -- bash ~/.config/helix/yazi-picker.sh" +y = ":sh zellij run -n 'Yazi picker' -f -x 10% -y 10% --width 80% --height 80% -- bash ~/.config/helix/yazi-picker.sh" ``` Then save the following script as `~/.config/helix/yazi-picker.sh`: ```sh #!/usr/bin/env bash + paths=$(yazi --chooser-file=/dev/stdout | xargs -I {} command printf "%q " {}) -zellij action toggle-floating-panes -zellij action write 27 # send key -zellij action write-chars ":open $paths" -zellij action write 13 # send key -zellij action toggle-floating-panes + +if [[ -n "$paths" ]]; then + zellij action toggle-floating-panes + zellij action write 27 # send key + zellij action write-chars ":open $paths" + zellij action write 13 # send key + zellij action toggle-floating-panes +fi + zellij action close-pane ```