aboutsummaryrefslogtreecommitdiffstats
path: root/config/yazi/plugins/git.yazi/README.md
blob: 042bac6c8249c45c122240bc0b35523511d2a8e9 (plain) (blame)
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
80
81
82
83
84
85
86
87
88
89
# 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

```sh
ya pkg add yazi-rs/plugins:git
```

## Setup

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

```lua
require("git"):setup {
	-- Order of status signs showing in the linemode
	order = 1500,
}
```

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

```toml
[[plugin.prepend_fetchers]]
id    = "git" # Remove if Yazi > v26.1.22
url   = "*"
run   = "git"
group = "git"

[[plugin.prepend_fetchers]]
id    = "git" # Remove if Yazi > v26.1.22
url   = "*/"
run   = "git"
group = "git"
```

## Advanced

> [!NOTE]
> The following configuration must be put before `require("git"):setup()`

You can customize the [Style](https://yazi-rs.github.io/docs/plugins/layout#style) of the status sign with:

- `[git].unknown` - status cannot/not yet determined
- `[git].modified` - modified file
- `[git].added` - added file
- `[git].untracked` - untracked file
- `[git].ignored` - ignored file
- `[git].deleted` - deleted file
- `[git].updated` - updated file
- `[git].clean` - clean file

For example:

```toml
# theme.toml / flavor.toml
[git]
modified = { fg = "blue" }
deleted  = { fg = "red", bold = true }
```

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

- `[git].unknown_sign` - status cannot/not yet determined
- `[git].modified_sign` - modified file
- `[git].added_sign` - added file
- `[git].untracked_sign` - untracked file
- `[git].ignored_sign` - ignored file
- `[git].deleted_sign` - deleted file
- `[git].updated_sign` - updated file
- `[git].clean_sign` - clean file

For example:

```toml
# theme.toml / flavor.toml
[git]
unknown_sign  = " "
modified_sign = "M"
deleted_sign  = "D"
clean_sign    = "✔"
```

## License

This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file.
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage