Skip to content

Latest commit

 

History

History
78 lines (56 loc) · 1.45 KB

README.md

File metadata and controls

78 lines (56 loc) · 1.45 KB

git.yazi

Note

Yazi v0.4.1 or later is required for this plugin to work.

Show the status of Git file changes as linemode in the file list.

screenshot-001986.mp4

Installation

ya pack -a 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

You can customize the Style of the status sign with:

  • THEME.git.modified
  • THEME.git.added
  • THEME.git.untracked
  • THEME.git.ignored
  • THEME.git.deleted
  • THEME.git.updated

For example:

-- ~/.config/yazi/init.lua
THEME.git = THEME.git or {}
THEME.git.modified = ui.Style():fg("blue")
THEME.git.deleted = ui.Style():fg("red"):bold()

You can also customize the text of the status sign with:

  • THEME.git.modified_sign
  • THEME.git.added_sign
  • THEME.git.untracked_sign
  • THEME.git.ignored_sign
  • THEME.git.deleted_sign
  • THEME.git.updated_sign

For example:

-- ~/.config/yazi/init.lua
THEME.git = THEME.git or {}
THEME.git.modified_sign = "M"
THEME.git.deleted_sign = "D"

License

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