From 49ec78e68aa35673d139a4bd00b6fe4085d4b2dc Mon Sep 17 00:00:00 2001 From: sxyazi Date: Sun, 18 Aug 2024 21:51:57 +0800 Subject: [PATCH] docs: add advanced usage example for hide-preview.yazi --- hide-preview.yazi/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hide-preview.yazi/README.md b/hide-preview.yazi/README.md index dc9fa85..44998cc 100644 --- a/hide-preview.yazi/README.md +++ b/hide-preview.yazi/README.md @@ -22,3 +22,16 @@ desc = "Hide or show preview" ``` Make sure the T 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://github.com/mikavilpas/yazi.nvim), the +preview is hidden by default - you can always press `T` (or any key you've bound) to display it again.