Revert "refactor: use ya.sync to simplify the code"

This commit is contained in:
Diogo Duarte
2024-02-10 07:37:25 +00:00
committed by GitHub
parent 6de87454d7
commit 49864342fa
2 changed files with 102 additions and 53 deletions

View File

@@ -1,44 +1,35 @@
# bookmarks.yazi
# Bookmarks.yazi
A [Yazi](https://github.com/sxyazi/yazi) plugin that adds the basic functionality of [vi-like marks](https://neovim.io/doc/user/motion.html#mark-motions).
> [!NOTE]
> The latest main branch of Yazi is required at the moment.
https://github.com/dedukun/bookmarks.yazi/assets/25795432/9a9fe345-dd06-442e-99f1-8475ab22fad5
## Installation
```sh
# Linux/macOS
git clone https://github.com/dedukun/bookmarks.yazi.git ~/.config/yazi/plugins/bookmarks.yazi
# Windows
git clone https://github.com/dedukun/bookmarks.yazi.git %AppData%\yazi\config\plugins\bookmarks.yazi
```
## Usage
Add this to your `keymap.toml`:
```toml
[[manager.prepend_keymap]]
on = [ "m" ]
exec = "plugin bookmarks --args=save"
desc = "Save current position as a bookmark"
exec = "plugin bookmarks --sync --args='set'"
desc = "Set a bookmark"
```
```toml
[[manager.prepend_keymap]]
on = [ "'" ]
exec = "plugin bookmarks --args=jump"
exec = "plugin bookmarks --sync --args='jump'"
desc = "Jump to a bookmark"
```
```toml
[[manager.prepend_keymap]]
on = [ "b", "d" ]
exec = "plugin bookmarks --args=delete"
desc = "Delete a bookmark"
exec = "plugin bookmarks --sync --args='delete'"
desc = "Jump to a bookmark"
```
```toml
[[manager.prepend_keymap]]
on = [ "b", "D" ]
exec = "plugin bookmarks --args=delete_all"
desc = "Delete all bookmarks"
exec = "plugin bookmarks --sync --args='deleteall'"
desc = "Jump to a bookmark"
```