103 lines
2 KiB
Markdown
103 lines
2 KiB
Markdown
|
# file-extra-metadata
|
||
|
|
||
|
<!--toc:start-->
|
||
|
|
||
|
- [file-extra-metadata](#file-extra-metadata)
|
||
|
- [Preview](#preview)
|
||
|
- [Before:](#before)
|
||
|
- [After:](#after)
|
||
|
- [Requirements](#requirements)
|
||
|
- [Installation](#installation)
|
||
|
- [For developer](#for-developer)
|
||
|
<!--toc:end-->
|
||
|
|
||
|
This is a Yazi plugin that replaces the default file previewer and spotter with extra information.
|
||
|
|
||
|
## Preview
|
||
|
|
||
|
### Before:
|
||
|
|
||
|
- Previewer
|
||
|
|
||
|

|
||
|
|
||
|
- Spotter (yazi >= v0.4 after 21/11/2024)
|
||
|
|
||
|

|
||
|
|
||
|
### After:
|
||
|
|
||
|
- Previewer
|
||
|
|
||
|

|
||
|
|
||
|
- Spotter (yazi >= v0.4 after 21/11/2024)
|
||
|
|
||
|

|
||
|
|
||
|
## Requirements
|
||
|
|
||
|
- [yazi >=0.4](https://github.com/sxyazi/yazi)
|
||
|
- Tested on Linux. For MacOS, Windows: some fields will shows empty values.
|
||
|
|
||
|
## Installation
|
||
|
|
||
|
Install the plugin:
|
||
|
|
||
|
```sh
|
||
|
ya pack -a boydaihungst/file-extra-metadata
|
||
|
```
|
||
|
|
||
|
Add spotter keybind, makes sure not conflict with other `<Tab>` keybind in
|
||
|
`manager` section:
|
||
|
|
||
|
```toml
|
||
|
[manager]
|
||
|
keymap = [
|
||
|
# ...
|
||
|
# Spotting
|
||
|
{ on = "<Tab>", run = "spot", desc = "Spot hovered file" },
|
||
|
]
|
||
|
```
|
||
|
|
||
|
Create `~/.config/yazi/yazi.toml` and add:
|
||
|
|
||
|
```toml
|
||
|
[plugin]
|
||
|
append_previewers = [
|
||
|
{ name = "*", run = "file-extra-metadata" },
|
||
|
]
|
||
|
# yazi v0.4 after 21/11/2024
|
||
|
# Setup keybind for spotter: https://github.com/sxyazi/yazi/pull/1802
|
||
|
append_spotters = [
|
||
|
{ name = "*", run = "file-extra-metadata" },
|
||
|
]
|
||
|
```
|
||
|
|
||
|
or
|
||
|
|
||
|
```toml
|
||
|
[plugin]
|
||
|
previewers = [
|
||
|
# ... the rest
|
||
|
# disable default file plugin { name = "*", run = "file" },
|
||
|
{ name = "*", run = "file-extra-metadata" },
|
||
|
]
|
||
|
# yazi v0.4 after 21/11/2024
|
||
|
# Setup keybind for spotter: https://github.com/sxyazi/yazi/pull/1802
|
||
|
spotters = [
|
||
|
# ... the rest
|
||
|
# Fallback
|
||
|
# { name = "*", run = "file" },
|
||
|
{ name = "*", run = "file-extra-metadata" },
|
||
|
]
|
||
|
```
|
||
|
|
||
|
## For developer
|
||
|
|
||
|
If you want to compile this with other spotter/previewer:
|
||
|
|
||
|
```lua
|
||
|
require("file-extra-metadata"):render_table(job, { show_plugins_section = true })
|
||
|
```
|