Add last modes

This commit is contained in:
Diogo Duarte
2025-02-18 11:07:42 +00:00
parent 420a384f51
commit 023bde5a53
2 changed files with 81 additions and 20 deletions

View File

@@ -23,10 +23,10 @@ ya pack -a dedukun/bookmarks
## Import/Export bookmarks
This plugin uses [Yazi's DDS](https://yazi-rs.github.io/docs/dds/) for bookmark persistence, as such,
This plugin uses [Yazi's DDS](https://yazi-rs.github.io/docs/dds/) for bookmark persistence, as such,
the bookmarks are saved in DDS's state file (`~/.local/state/yazi/.dds` on Linux and `C:\Users\USERNAME\AppData\Roaming\yazi\state\.dds` on Windows)
***NOTE:*** This system may be used by other plugins that you have installed, so this file might have more data than just the bookmarks.
**_NOTE:_** This system may be used by other plugins that you have installed, so this file might have more data than just the bookmarks.
## Configuration
@@ -62,7 +62,7 @@ The following are the default configurations:
```lua
-- ~/.config/yazi/init.lua
require("bookmarks"):setup({
last_directory = { enable = false, persist = false },
last_directory = { enable = false, persist = false, mode="jump" },
persist = "none",
desc_format = "full",
file_pick_mode = "hover",
@@ -85,6 +85,14 @@ the last directory.
There's also the option to enable persistence to this automatic bookmark.
Finally, there's a `mode` option with the following options:
| Value | Description |
| ------ | --------------------------------------------------- |
| `jump` | Default, It saves the last used mark |
| `mark` | It saves the last created mark |
| `dir` | It saves the last visited directory (old behaviour) |
### `persist`
When enabled the bookmarks will persist, i.e. if you close and reopen Yazi they will still be