Files
2025-12-30 07:58:34 +08:00
..
2025-03-08 14:18:32 +08:00
2025-12-30 07:58:34 +08:00
2025-12-29 09:57:25 +08:00

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, and @sxyazi

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

Installation

Install the plugin itself, and jdberry/tag used to tag files:

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

Setup

Add the following to your ~/.config/yazi/init.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:

[[plugin.prepend_fetchers]]
id  = "mactag"
url = "*"
run = "mactag"

[[plugin.prepend_fetchers]]
id  = "mactag"
url = "*/"
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:

[[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"

Note that, the keybindings above are just examples, please tune them up as needed to ensure they don't conflict with your other commands/plugins.

License

This plugin is MIT-licensed. For more information check the LICENSE file.