feat: complete mactag.yazi

This commit is contained in:
sxyazi
2024-09-28 22:22:36 +08:00
parent c578505961
commit 0949e7654d
4 changed files with 40 additions and 18 deletions

View File

@@ -4,8 +4,6 @@ Bring macOS's awesome tagging feature to Yazi! The plugin it's only available fo
Authors: [@AnirudhG07](https://github.com/AnirudhG07), and [@sxyazi](https://github.com/sxyazi)
Note that this plugin is still under development.
## Installation
Install the plugin itself, and [jdberry/tag](https://github.com/jdberry/tag) used to tag files:
@@ -22,6 +20,14 @@ Add the following to your `~/.config/yazi/init.lua`:
```lua
require("mactag"):setup {
-- You can change the colors of the tags here
keys = {
r = "Red",
o = "Orange",
y = "Yellow",
g = "Green",
b = "Blue",
p = "Purple",
},
colors = {
Red = "#ee7b70",
Orange = "#f5bd5c",
@@ -29,7 +35,6 @@ require("mactag"):setup {
Green = "#91fc87",
Blue = "#5fa3f8",
Purple = "#cb88f8",
Gray = "#b5b5b9",
},
}
```
@@ -54,14 +59,12 @@ This plugin also provides the functionality to add and remove tags. Add followin
```toml
[[manager.prepend_keymap]]
on = [ "b", "r" ]
run = 'plugin mactag --args="add Red"'
desc = "Tag selected files with red"
on = [ "b", "a" ]
run = 'plugin mactag --args="add"'
desc = "Add tag to selected files"
[[manager.prepend_keymap]]
on = [ "b", "R" ]
run = 'plugin mactag --args="remove Red"'
desc = "Remove red tag from selected files"
on = [ "b", "r" ]
run = 'plugin mactag --args="remove"'
desc = "Remove tag from selected files"
```
`Red` can be any tag name you like. To add/remove multiple tags at once, use a comma (`,`) to separate them, like `Red,Yellow`.