mirror of
https://github.com/kristoferssolo/solorice.git
synced 2026-02-04 06:32:03 +00:00
Update: 2024-10-17
This commit is contained in:
@@ -7,7 +7,7 @@ https://github.com/yazi-rs/plugins/assets/17523360/c4f0b5c4-ff9f-4be8-ba73-4d8e7
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
ya pack -a yazi-rs/plugins#hide-preview
|
||||
ya pack -a yazi-rs/plugins:hide-preview
|
||||
```
|
||||
|
||||
## Usage
|
||||
@@ -22,3 +22,20 @@ 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.
|
||||
|
||||
@@ -18,4 +18,6 @@ local function entry(st)
|
||||
ya.app_emit("resize", {})
|
||||
end
|
||||
|
||||
return { entry = entry }
|
||||
local function enabled(st) return st.old ~= nil end
|
||||
|
||||
return { entry = entry, enabled = enabled }
|
||||
|
||||
Reference in New Issue
Block a user