Skip to content

Commit

Permalink
docs: enlarge Yazi picker window
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed May 8, 2024
1 parent 7ebe6d4 commit 7792d18
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions docs/tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -446,19 +446,24 @@ Add a keymap to your Helix config, for example <kbd>'</kbd> + <kbd>y</kbd>:
```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 <Escape> key
zellij action write-chars ":open $paths"
zellij action write 13 # send <Enter> key
zellij action toggle-floating-panes

if [[ -n "$paths" ]]; then
zellij action toggle-floating-panes
zellij action write 27 # send <Escape> key
zellij action write-chars ":open $paths"
zellij action write 13 # send <Enter> key
zellij action toggle-floating-panes
fi

zellij action close-pane
```

Expand Down

0 comments on commit 7792d18

Please sign in to comment.