feat: more Yazi v25.5.28 goodies

This commit is contained in:
sxyazi
2025-05-28 23:06:18 +08:00
parent d642bfb082
commit f9b3f8876e
23 changed files with 45 additions and 55 deletions

View File

@@ -5,7 +5,7 @@
# Plugins
The following plugins can be installed using the [`ya pack` package manager](https://yazi-rs.github.io/docs/cli#package-manager) introduced in Yazi v0.3.
The following plugins can be installed using the [`ya pkg` package manager](https://yazi-rs.github.io/docs/cli#package-manager) introduced in Yazi v25.5.28.
For specific installation commands and configuration instructions, check the individual `README.md` of each plugin by clicking the link below:

View File

@@ -7,7 +7,7 @@ https://github.com/yazi-rs/plugins/assets/17523360/7aa3abc2-d057-498c-8473-a6282
## Installation
```sh
ya pack -a yazi-rs/plugins:chmod
ya pkg add yazi-rs/plugins:chmod
```
## Usage
@@ -15,7 +15,7 @@ ya pack -a yazi-rs/plugins:chmod
Add this to your `~/.config/yazi/keymap.toml`:
```toml
[[manager.prepend_keymap]]
[[mgr.prepend_keymap]]
on = [ "c", "m" ]
run = "plugin chmod"
desc = "Chmod on selected files"

View File

@@ -7,7 +7,7 @@ https://github.com/yazi-rs/plugins/assets/17523360/eff5e949-386a-44ea-82f9-4cb4a
## Installation
```sh
ya pack -a yazi-rs/plugins:diff
ya pkg add yazi-rs/plugins:diff
```
## Usage
@@ -15,7 +15,7 @@ ya pack -a yazi-rs/plugins:diff
Add this to your `~/.config/yazi/keymap.toml`:
```toml
[[manager.prepend_keymap]]
[[mgr.prepend_keymap]]
on = "<C-d>"
run = "plugin diff"
desc = "Diff the selected with the hovered file"

View File

@@ -7,7 +7,7 @@ Add a full border to Yazi to make it look fancier.
## Installation
```sh
ya pack -a yazi-rs/plugins:full-border
ya pkg add yazi-rs/plugins:full-border
```
## Usage

View File

@@ -7,10 +7,10 @@ local function setup(_, opts)
Tab.build = function(self, ...)
local bar = function(c, x, y)
if x <= 0 or x == self._area.w - 1 or th.mgr.border_symbol ~= "" then
return ui.Bar(ui.Bar.TOP)
return ui.Bar(ui.Edge.TOP)
end
return ui.Bar(ui.Bar.TOP)
return ui.Bar(ui.Edge.TOP)
:area(
ui.Rect { x = x, y = math.max(0, y), w = ya.clamp(0, self._area.w - x, 1), h = math.min(1, self._area.h) }
)
@@ -26,9 +26,9 @@ local function setup(_, opts)
local style = th.mgr.border_style
self._base = ya.list_merge(self._base or {}, {
ui.Border(ui.Border.ALL):area(self._area):type(type):style(style),
ui.Bar(ui.Bar.RIGHT):area(self._chunks[1]):style(style),
ui.Bar(ui.Bar.LEFT):area(self._chunks[3]):style(style),
ui.Border(ui.Edge.ALL):area(self._area):type(type):style(style),
ui.Bar(ui.Edge.RIGHT):area(self._chunks[1]):style(style),
ui.Bar(ui.Edge.LEFT):area(self._chunks[3]):style(style),
bar("", c[1].right - 1, c[1].y),
bar("", c[1].right - 1, c[1].bottom - 1),

View File

@@ -7,7 +7,7 @@ https://github.com/user-attachments/assets/34976be9-a871-4ffe-9d5a-c4cdd0bf4576
## Installation
```sh
ya pack -a yazi-rs/plugins:git
ya pkg add yazi-rs/plugins:git
```
## Setup

View File

@@ -7,7 +7,7 @@ https://github.com/yazi-rs/plugins/assets/17523360/aac9341c-b416-4e0c-aaba-889d4
## Installation
```sh
ya pack -a yazi-rs/plugins:jump-to-char
ya pkg add yazi-rs/plugins:jump-to-char
```
## Usage
@@ -15,7 +15,7 @@ ya pack -a yazi-rs/plugins:jump-to-char
Add this to your `~/.config/yazi/keymap.toml`:
```toml
[[manager.prepend_keymap]]
[[mgr.prepend_keymap]]
on = "f"
run = "plugin jump-to-char"
desc = "Jump to char"

View File

@@ -10,7 +10,7 @@ but we strongly discourage using it unless you encounter some issues with `7zip`
## Installation
```sh
ya pack -a yazi-rs/plugins:lsar
ya pkg add yazi-rs/plugins:lsar
```
## Usage

View File

@@ -11,7 +11,7 @@ https://github.com/user-attachments/assets/7f26dc6d-67a5-4a85-a99e-4671ece9ae56
Install the plugin itself, and [jdberry/tag](https://github.com/jdberry/tag) used to tag files:
```sh
ya pack -a yazi-rs/plugins:mactag
ya pkg add yazi-rs/plugins:mactag
brew update && brew install tag
```
@@ -63,12 +63,12 @@ Besides displaying tags attached to files, you can also add or remove tags withi
Add following keybindings to your `~/.config/yazi/keymap.toml` to enable it:
```toml
[[manager.prepend_keymap]]
[[mgr.prepend_keymap]]
on = [ "b", "a" ]
run = "plugin mactag add"
desc = "Tag selected files"
[[manager.prepend_keymap]]
[[mgr.prepend_keymap]]
on = [ "b", "r" ]
run = "plugin mactag remove"
desc = "Untag selected files"

View File

@@ -7,7 +7,7 @@ See https://yazi-rs.github.io/docs/tips#make-yazi-even-faster for more informati
## Installation
```sh
ya pack -a yazi-rs/plugins:mime-ext
ya pkg add yazi-rs/plugins:mime-ext
```
## Usage

View File

@@ -12,7 +12,7 @@ https://github.com/user-attachments/assets/c6f780ab-458b-420f-85cf-2fc45fcfe3a2
## Installation
```sh
ya pack -a yazi-rs/plugins:mount
ya pkg add yazi-rs/plugins:mount
```
## Usage
@@ -20,7 +20,7 @@ ya pack -a yazi-rs/plugins:mount
Add this to your `~/.config/yazi/keymap.toml`:
```toml
[[manager.prepend_keymap]]
[[mgr.prepend_keymap]]
on = "M"
run = "plugin mount"
```

View File

@@ -155,11 +155,11 @@ function M:redraw()
return {
ui.Clear(self._area),
ui.Border(ui.Border.ALL)
ui.Border(ui.Edge.ALL)
:area(self._area)
:type(ui.Border.ROUNDED)
:style(ui.Style():fg("blue"))
:title(ui.Line("Mount"):align(ui.Line.CENTER)),
:title(ui.Line("Mount"):align(ui.Align.CENTER)),
ui.Table(rows)
:area(self._area:pad(ui.Pad(1, 2, 1, 2)))
:header(ui.Row({ "Src", "Label", "Dist", "FSType" }):style(ui.Style():bold()))

View File

@@ -7,7 +7,7 @@ Remove the status bar.
## Installation
```sh
ya pack -a yazi-rs/plugins:no-status
ya pkg add yazi-rs/plugins:no-status
```
## Usage

View File

@@ -5,7 +5,7 @@ Pipe any shell command as a previewer.
## Installation
```sh
ya pack -a yazi-rs/plugins:piper
ya pkg add yazi-rs/plugins:piper
```
## Usage

View File

@@ -2,11 +2,7 @@
local M = {}
local function fail(job, s)
ya.preview_widgets(job, {
ui.Text.parse(s):area(job.area):wrap(ui.Text.WRAP),
})
end
local function fail(job, s) ya.preview_widget(job, ui.Text.parse(s):area(job.area):wrap(ui.Wrap.YES)) end
function M:peek(job)
local child, err = Command("sh")
@@ -43,7 +39,7 @@ function M:peek(job)
elseif job.skip > 0 and i < job.skip + limit then
ya.emit("peek", { math.max(0, i - limit), only_if = job.file.url, upper_bound = true })
else
ya.preview_widgets(job, { M.format(job, outs) })
ya.preview_widget(job, M.format(job, outs))
end
end

View File

@@ -5,7 +5,7 @@
## Installation
```sh
ya pack -a yazi-rs/plugins:smart-enter
ya pkg add yazi-rs/plugins:smart-enter
```
## Usage
@@ -13,7 +13,7 @@ ya pack -a yazi-rs/plugins:smart-enter
Bind your <kbd>l</kbd> key to the plugin, in your `~/.config/yazi/keymap.toml`:
```toml
[[manager.prepend_keymap]]
[[mgr.prepend_keymap]]
on = "l"
run = "plugin smart-enter"
desc = "Enter the child directory, or open the file"
@@ -36,5 +36,5 @@ require("smart-enter"):setup {
This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file.
[open]: https://yazi-rs.github.io/docs/configuration/keymap/#manager.open
[enter]: https://yazi-rs.github.io/docs/configuration/keymap/#manager.enter
[open]: https://yazi-rs.github.io/docs/configuration/keymap/#mgr.open
[enter]: https://yazi-rs.github.io/docs/configuration/keymap/#mgr.enter

View File

@@ -7,7 +7,7 @@ https://github.com/yazi-rs/plugins/assets/17523360/72aaf117-1378-4f7e-93ba-d425a
## Installation
```sh
ya pack -a yazi-rs/plugins:smart-filter
ya pkg add yazi-rs/plugins:smart-filter
```
## Usage
@@ -15,7 +15,7 @@ ya pack -a yazi-rs/plugins:smart-filter
Add this to your `~/.config/yazi/keymap.toml`:
```toml
[[manager.prepend_keymap]]
[[mgr.prepend_keymap]]
on = "F"
run = "plugin smart-filter"
desc = "Smart filter"

View File

@@ -7,7 +7,7 @@ https://github.com/user-attachments/assets/b3f6348e-abbe-42fe-9a67-a96e68f11255
## Installation
```sh
ya pack -a yazi-rs/plugins:smart-paste
ya pkg add yazi-rs/plugins:smart-paste
```
## Usage
@@ -15,7 +15,7 @@ ya pack -a yazi-rs/plugins:smart-paste
Add this to your `~/.config/yazi/keymap.toml`:
```toml
[[manager.prepend_keymap]]
[[mgr.prepend_keymap]]
on = "p"
run = "plugin smart-paste"
desc = "Paste into the hovered directory or CWD"

View File

@@ -5,7 +5,7 @@ Just an example showing how to use `sudo` in a Yazi plugin, and the plugin itsel
## Installation
```sh
ya pack -a yazi-rs/plugins:sudo-demo
ya pkg add yazi-rs/plugins:sudo-demo
```
## Usage
@@ -13,7 +13,7 @@ ya pack -a yazi-rs/plugins:sudo-demo
Add this to your `~/.config/yazi/keymap.toml`:
```toml
[[manager.prepend_keymap]]
[[mgr.prepend_keymap]]
on = "<C-t>"
run = "plugin sudo-demo"
```

View File

@@ -1,6 +1,6 @@
# toggle-pane.yazi
Toggle the show, hide, and maximize states for different panes: parent, current, and preview. It respects the user's [`ratio` settings](https://yazi-rs.github.io/docs/configuration/yazi#manager.ratio)!
Toggle the show, hide, and maximize states for different panes: parent, current, and preview. It respects the user's [`ratio` settings](https://yazi-rs.github.io/docs/configuration/yazi#mgr.ratio)!
Assume the user's `ratio` is $$[A, B, C]$$, that is, $$\text{parent}=A, \text{current}=B, \text{preview}=C$$:
@@ -15,7 +15,7 @@ Assume the user's `ratio` is $$[A, B, C]$$, that is, $$\text{parent}=A, \text{cu
## Installation
```sh
ya pack -a yazi-rs/plugins:toggle-pane
ya pkg add yazi-rs/plugins:toggle-pane
```
## Usage
@@ -24,7 +24,7 @@ Hide/Show preview:
```toml
# keymap.toml
[[manager.prepend_keymap]]
[[mgr.prepend_keymap]]
on = "T"
run = "plugin toggle-pane min-preview"
desc = "Show or hide the preview pane"
@@ -34,7 +34,7 @@ Maximize/Restore preview:
```toml
# keymap.toml
[[manager.prepend_keymap]]
[[mgr.prepend_keymap]]
on = "T"
run = "plugin toggle-pane max-preview"
desc = "Maximize or restore the preview pane"

View File

@@ -39,13 +39,7 @@ local function entry(st, job)
Tab.layout, st.old = st.old, nil
st.parent, st.current, st.preview = nil, nil, nil
end
-- TODO: remove this in the future
if ya.emit then
ya.emit("app:resize", {})
else
ya.app_emit("resize", {})
end
ya.emit("app:resize", {})
end
return { entry = entry }

View File

@@ -5,7 +5,7 @@ Type definitions for Yazi's Lua API, empowering an efficient plugin development
## Installation
```sh
ya pack -a yazi-rs/plugins:types
ya pkg add yazi-rs/plugins:types
```
## Usage

View File

@@ -7,14 +7,14 @@ https://github.com/user-attachments/assets/465b801b-3516-4f57-be09-8405da21e34d
## Installation
```sh
ya pack -a yazi-rs/plugins:vcs-files
ya pkg add yazi-rs/plugins:vcs-files
```
## Usage
```toml
# keymap.toml
[[manager.prepend_keymap]]
[[mgr.prepend_keymap]]
on = [ "g", "c" ]
run = "plugin vcs-files"
desc = "Show Git file changes"