refactor: remove deprecated hide-preview.yazi and max-preview.yazi (as of Feb 20, 2025)
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
../LICENSE
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
# hide-preview.yazi
|
|
||||||
|
|
||||||
> [!WARNING]
|
|
||||||
> This plugin has been deprecated. Please use the new [toggle-pane.yazi](../toggle-pane.yazi) instead.
|
|
||||||
|
|
||||||
Switch the preview pane between hidden and shown.
|
|
||||||
|
|
||||||
https://github.com/yazi-rs/plugins/assets/17523360/c4f0b5c4-ff9f-4be8-ba73-4d8e7902e383
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
```sh
|
|
||||||
ya pack -a yazi-rs/plugins:hide-preview
|
|
||||||
```
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
Add this to your `~/.config/yazi/keymap.toml`:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[[manager.prepend_keymap]]
|
|
||||||
on = "T"
|
|
||||||
run = "plugin hide-preview"
|
|
||||||
desc = "Hide or show preview"
|
|
||||||
```
|
|
||||||
|
|
||||||
Make sure the <kbd>T</kbd> key is not used elsewhere.
|
|
||||||
|
|
||||||
## Advanced
|
|
||||||
|
|
||||||
In addition to triggering the plugin with a keypress, you can also trigger it in your `init.lua` file:
|
|
||||||
|
|
||||||
```lua
|
|
||||||
if os.getenv("NVIM") then
|
|
||||||
require("hide-preview"):entry()
|
|
||||||
end
|
|
||||||
```
|
|
||||||
|
|
||||||
In the example above, when it detects that you're [using Yazi in nvim](https://yazi-rs.github.io/docs/resources#vim), the
|
|
||||||
preview is hidden by default - you can always press `T` (or any key you've bound) to display it again.
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file.
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
--- @since 25.2.26
|
|
||||||
--- @sync entry
|
|
||||||
|
|
||||||
local function entry(st)
|
|
||||||
ya.notify {
|
|
||||||
title = "Deprecated plugin",
|
|
||||||
content = "The `hide-preview` plugin is deprecated, please use the new `toggle-pane` plugin instead: https://github.com/yazi-rs/plugins/tree/main/toggle-pane.yazi",
|
|
||||||
timeout = 10,
|
|
||||||
level = "warn",
|
|
||||||
}
|
|
||||||
|
|
||||||
if st.old then
|
|
||||||
Tab.layout, st.old = st.old, nil
|
|
||||||
else
|
|
||||||
st.old = Tab.layout
|
|
||||||
Tab.layout = function(self)
|
|
||||||
local r = rt.mgr.ratio
|
|
||||||
self._chunks = ui.Layout()
|
|
||||||
:direction(ui.Layout.HORIZONTAL)
|
|
||||||
:constraints({
|
|
||||||
ui.Constraint.Ratio(r.parent, r.parent + r.current),
|
|
||||||
ui.Constraint.Ratio(r.current, r.parent + r.current),
|
|
||||||
ui.Constraint.Length(1),
|
|
||||||
})
|
|
||||||
:split(self._area)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
ya.app_emit("resize", {})
|
|
||||||
end
|
|
||||||
|
|
||||||
local function enabled(st) return st.old ~= nil end
|
|
||||||
|
|
||||||
return { entry = entry, enabled = enabled }
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
../LICENSE
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
# max-preview.yazi
|
|
||||||
|
|
||||||
> [!WARNING]
|
|
||||||
> This plugin has been deprecated. Please use the new [toggle-pane.yazi](../toggle-pane.yazi) instead.
|
|
||||||
|
|
||||||
Maximize or restore the preview pane.
|
|
||||||
|
|
||||||
https://github.com/yazi-rs/plugins/assets/17523360/8976308e-ebfe-4e9e-babe-153eb1f87d61
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
```sh
|
|
||||||
ya pack -a yazi-rs/plugins:max-preview
|
|
||||||
```
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
Add this to your `~/.config/yazi/keymap.toml`:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[[manager.prepend_keymap]]
|
|
||||||
on = "T"
|
|
||||||
run = "plugin max-preview"
|
|
||||||
desc = "Maximize or restore preview"
|
|
||||||
```
|
|
||||||
|
|
||||||
Make sure the <kbd>T</kbd> key is not used elsewhere.
|
|
||||||
|
|
||||||
## Tips
|
|
||||||
|
|
||||||
This plugin only maximizes the "available preview area", without actually changing the content size.
|
|
||||||
|
|
||||||
This means that the appearance of your preview largely depends on the previewer you are using.
|
|
||||||
However, most previewers tend to make the most of the available space, so this usually isn't an issue.
|
|
||||||
|
|
||||||
For image previews, you may want to tune up the [`max_width`][max-width] and [`max_height`][max-height] options in your `yazi.toml`:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[preview]
|
|
||||||
# Change them to your desired values
|
|
||||||
max_width = 1000
|
|
||||||
max_height = 1000
|
|
||||||
```
|
|
||||||
|
|
||||||
[max-width]: https://yazi-rs.github.io/docs/configuration/yazi/#preview.max_width
|
|
||||||
[max-height]: https://yazi-rs.github.io/docs/configuration/yazi/#preview.max_height
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file.
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
--- @since 25.2.7
|
|
||||||
--- @sync entry
|
|
||||||
|
|
||||||
local function entry(st)
|
|
||||||
ya.notify {
|
|
||||||
title = "Deprecated plugin",
|
|
||||||
content = "The `max-preview` plugin is deprecated, please use the new `toggle-pane` plugin instead: https://github.com/yazi-rs/plugins/tree/main/toggle-pane.yazi",
|
|
||||||
timeout = 10,
|
|
||||||
level = "warn",
|
|
||||||
}
|
|
||||||
|
|
||||||
if st.old then
|
|
||||||
Tab.layout, st.old = st.old, nil
|
|
||||||
else
|
|
||||||
st.old = Tab.layout
|
|
||||||
Tab.layout = function(self)
|
|
||||||
self._chunks = ui.Layout()
|
|
||||||
:direction(ui.Layout.HORIZONTAL)
|
|
||||||
:constraints({
|
|
||||||
ui.Constraint.Percentage(0),
|
|
||||||
ui.Constraint.Percentage(0),
|
|
||||||
ui.Constraint.Percentage(100),
|
|
||||||
})
|
|
||||||
:split(self._area)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
ya.app_emit("resize", {})
|
|
||||||
end
|
|
||||||
|
|
||||||
local function enabled(st) return st.old ~= nil end
|
|
||||||
|
|
||||||
return { entry = entry, enabled = enabled }
|
|
||||||
Reference in New Issue
Block a user