Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/llanosrocas/githead.yazi
Git status header for yazi inspired by powerlevel10k
https://github.com/llanosrocas/githead.yazi
header-line lua yazi yazi-plugin
Last synced: about 4 hours ago
JSON representation
Git status header for yazi inspired by powerlevel10k
- Host: GitHub
- URL: https://github.com/llanosrocas/githead.yazi
- Owner: llanosrocas
- License: mit
- Created: 2024-07-21T16:08:56.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-08-03T20:42:36.000Z (3 months ago)
- Last Synced: 2024-08-03T21:42:25.014Z (3 months ago)
- Topics: header-line, lua, yazi, yazi-plugin
- Language: Lua
- Homepage:
- Size: 531 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-yazi - githead - Git status header for yazi inspired by powerlevel10k. (Plugins)
- awesome-yazi - githead - Git status header for yazi inspired by powerlevel10k. (Plugins)
README
# githead.yazi
Git status header for yazi inspired by [powerlevel10k](https://github.com/romkatv/powerlevel10k?tab=readme-ov-file#what-do-different-symbols-in-git-status-mean).
![preview](https://github.com/llanosrocas/githead.yazi/blob/main/.github/images/preview.png)
All supported features are listed [here](#features)
## Requirements
- yazi version >= 0.3.0
- Font with symbol support. For example [Nerd Fonts](https://www.nerdfonts.com/).## Installation
```sh
ya pack -a llanosrocas/githead
```Or manually copy `init.lua` to the `~/.config/yazi/plugins/githead.yazi/init.lua`
## Usage
Add this to your `~/.config/yazi/init.lua`:
```lua
require("githead"):setup()
```Read more about indicators [here](https://github.com/romkatv/powerlevel10k?tab=readme-ov-file#what-do-different-symbols-in-git-status-mean).
Optionally, configure header:
```lua
require("githead"):setup({
show_branch = true,
branch_prefix = "on",
branch_color = "blue",
branch_symbol = "",
branch_borders = "()",commit_color = "bright magenta",
commit_symbol = "@",show_behind_ahead = true,
behind_color = "bright magenta",
behind_symbol = "⇣",
ahead_color = "bright magenta",
ahead_symbol = "⇡",show_stashes = true,
stashes_color = "bright magenta",
stashes_symbol = "$",show_state = true,
show_state_prefix = true,
state_color = "red",
state_symbol = "~",show_staged = true,
staged_color = "bright yellow",
staged_symbol = "+",show_unstaged = true,
unstaged_color = "bright yellow",
unstaged_symbol = "!",show_untracked = true,
untracked_color = "blue",
untracked_symbol = "?",
})
```## Features
- [x] Current branch (or current commit if branch is not presented)
- [x] Behind/Ahead of the remote
- [x] Stashes
- [x] States
- [x] merge
- [x] cherry
- [x] rebase (+ done counter)
- [x] Staged
- [x] Unstaged
- [x] Untracked### Under the hood
The goal is to use minimum amount of shell commands.
```shell
git status --ignore-submodules=dirty --branch --show-stash
```This command provides information about branches, stashes, staged files, unstaged files, untracked files, and other statistics.
## Credits
- [yazi source code](https://github.com/sxyazi/yazi)
- [powerlevel10k](https://github.com/romkatv/powerlevel10k)