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 ```