@@ -17,8 +17,8 @@ It accepts a string parameter, which is the shell command to be executed, for ex
|
|||||||
```toml
|
```toml
|
||||||
# ~/.config/yazi/yazi.toml
|
# ~/.config/yazi/yazi.toml
|
||||||
[[plugin.prepend_previewers]]
|
[[plugin.prepend_previewers]]
|
||||||
name = "*"
|
url = "*"
|
||||||
run = 'piper -- echo "$1"'
|
run = 'piper -- echo "$1"'
|
||||||
```
|
```
|
||||||
|
|
||||||
This will set `piper` as the previewer for all file types and use `$1` (file path) as the preview content.
|
This will set `piper` as the previewer for all file types and use `$1` (file path) as the preview content.
|
||||||
@@ -39,8 +39,8 @@ Here are some configuration examples:
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
[[plugin.prepend_previewers]]
|
[[plugin.prepend_previewers]]
|
||||||
name = "*.tar*"
|
url = "*.tar*"
|
||||||
run = 'piper --format=url -- tar tf "$1"'
|
run = 'piper --format=url -- tar tf "$1"'
|
||||||
```
|
```
|
||||||
|
|
||||||
In this example, `--format=url` tells `piper` to parse the `tar` output as file URLs, so you'll be able to get a list of files with icons.
|
In this example, `--format=url` tells `piper` to parse the `tar` output as file URLs, so you'll be able to get a list of files with icons.
|
||||||
@@ -49,8 +49,8 @@ In this example, `--format=url` tells `piper` to parse the `tar` output as file
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
[[plugin.prepend_previewers]]
|
[[plugin.prepend_previewers]]
|
||||||
name = "*.csv"
|
url = "*.csv"
|
||||||
run = 'piper -- bat -p --color=always "$1"'
|
run = 'piper -- bat -p --color=always "$1"'
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that certain distributions might use a different name for `bat`, like Debian and Ubuntu uses `batcat` instead, so please adjust accordingly.
|
Note that certain distributions might use a different name for `bat`, like Debian and Ubuntu uses `batcat` instead, so please adjust accordingly.
|
||||||
@@ -59,8 +59,8 @@ Note that certain distributions might use a different name for `bat`, like Debia
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
[[plugin.prepend_previewers]]
|
[[plugin.prepend_previewers]]
|
||||||
name = "*.md"
|
url = "*.md"
|
||||||
run = 'piper -- CLICOLOR_FORCE=1 glow -w=$w -s=dark "$1"'
|
run = 'piper -- CLICOLOR_FORCE=1 glow -w=$w -s=dark "$1"'
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that there's [a bug in Glow v2.0](https://github.com/charmbracelet/glow/issues/440#issuecomment-2307992634) that causes slight color differences between tty and non-tty environments.
|
Note that there's [a bug in Glow v2.0](https://github.com/charmbracelet/glow/issues/440#issuecomment-2307992634) that causes slight color differences between tty and non-tty environments.
|
||||||
@@ -69,8 +69,8 @@ Note that there's [a bug in Glow v2.0](https://github.com/charmbracelet/glow/iss
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
[[plugin.prepend_previewers]]
|
[[plugin.prepend_previewers]]
|
||||||
name = "*/"
|
url = "*/"
|
||||||
run = 'piper -- eza -TL=3 --color=always --icons=always --group-directories-first --no-quotes "$1"'
|
run = 'piper -- eza -TL=3 --color=always --icons=always --group-directories-first --no-quotes "$1"'
|
||||||
```
|
```
|
||||||
|
|
||||||
### Use [`hexyl`](https://github.com/sharkdp/hexyl) as fallback previewer
|
### Use [`hexyl`](https://github.com/sharkdp/hexyl) as fallback previewer
|
||||||
@@ -81,8 +81,8 @@ This example uses `hexyl` as a fallback previewer instead of `file`.
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
[[plugin.append_previewers]]
|
[[plugin.append_previewers]]
|
||||||
name = "*"
|
url = "*"
|
||||||
run = 'piper -- hexyl --border=none --terminal-width=$w "$1"'
|
run = 'piper -- hexyl --border=none --terminal-width=$w "$1"'
|
||||||
```
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|||||||
Reference in New Issue
Block a user