feat: support customizing git status sign and style, closes #21

This commit is contained in:
sxyazi
2024-09-12 18:51:26 +08:00
parent 549d76614d
commit 0b9f325fe9
3 changed files with 50 additions and 11 deletions

View File

@@ -34,3 +34,42 @@ id = "git"
name = "*/"
run = "git"
```
## Advanced
> [!NOTE]
> This section currently requires Yazi nightly that includes https://github.com/sxyazi/yazi/pull/1637
You can customize the [Style](https://yazi-rs.github.io/docs/plugins/layout#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:
```lua
-- ~/.config/yazi/init.lua
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:
```lua
-- ~/.config/yazi/init.lua
THEME.git_modified_sign = "M"
THEME.git_deleted_sign = "D"
```