summaryrefslogtreecommitdiff
path: root/debian/.config/yazi/plugins/mactag.yazi/README.md
blob: e5c060b5fa8a3022289d3471b3a8fd812a6f4d68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# mactag.yazi

Bring macOS's awesome tagging feature to Yazi! The plugin it's only available for macOS just like the name says.

Authors: [@AnirudhG07](https://github.com/AnirudhG07), and [@sxyazi](https://github.com/sxyazi)

https://github.com/user-attachments/assets/7f26dc6d-67a5-4a85-a99e-4671ece9ae56

## Installation

Install the plugin itself, and [jdberry/tag](https://github.com/jdberry/tag) used to tag files:

```sh
ya pkg add yazi-rs/plugins:mactag
brew update && brew install tag
```

## Setup

Add the following to your `~/.config/yazi/init.lua`:

```lua
require("mactag"):setup {
	-- Keys used to add or remove tags
	keys = {
		r = "Red",
		o = "Orange",
		y = "Yellow",
		g = "Green",
		b = "Blue",
		p = "Purple",
	},
	-- Colors used to display tags
	colors = {
		Red    = "#ee7b70",
		Orange = "#f5bd5c",
		Yellow = "#fbe764",
		Green  = "#91fc87",
		Blue   = "#5fa3f8",
		Purple = "#cb88f8",
	},
}
```

And register it as fetchers in your `~/.config/yazi/yazi.toml`:

```toml
[[plugin.prepend_fetchers]]
id   = "mactag"
name = "*"
run  = "mactag"

[[plugin.prepend_fetchers]]
id   = "mactag"
name = "*/"
run  = "mactag"
```

## Usage

Besides displaying tags attached to files, you can also add or remove tags within Yazi using this plugin.

Add following keybindings to your `~/.config/yazi/keymap.toml` to enable it:

```toml
[[mgr.prepend_keymap]]
on   = [ "b", "a" ]
run  = "plugin mactag add"
desc = "Tag selected files"

[[mgr.prepend_keymap]]
on   = [ "b", "r" ]
run  = "plugin mactag remove"
desc = "Untag selected files"
```

## License

This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file.