1.4 KiB
1.4 KiB
git.yazi
Show the status of Git file changes as linemode in the file list.
https://github.com/user-attachments/assets/34976be9-a871-4ffe-9d5a-c4cdd0bf4576
Installation
ya pkg add yazi-rs/plugins:git
Setup
Add the following to your ~/.config/yazi/init.lua:
require("git"):setup()
And register it as fetchers in your ~/.config/yazi/yazi.toml:
[[plugin.prepend_fetchers]]
id = "git"
name = "*"
run = "git"
[[plugin.prepend_fetchers]]
id = "git"
name = "*/"
run = "git"
Advanced
Note
The following configuration must be put before
require("git"):setup()
You can customize the Style of the status sign with:
th.git.modifiedth.git.addedth.git.untrackedth.git.ignoredth.git.deletedth.git.updated
For example:
-- ~/.config/yazi/init.lua
th.git = th.git or {}
th.git.modified = ui.Style():fg("blue")
th.git.deleted = ui.Style():fg("red"):bold()
You can also customize the text of the status sign with:
th.git.modified_signth.git.added_signth.git.untracked_signth.git.ignored_signth.git.deleted_signth.git.updated_sign
For example:
-- ~/.config/yazi/init.lua
th.git = th.git or {}
th.git.modified_sign = "M"
th.git.deleted_sign = "D"
License
This plugin is MIT-licensed. For more information check the LICENSE file.