feat(starship): show jj status in prompt
This commit is contained in:
parent
d502780cae
commit
9b0d31df39
1 changed files with 27 additions and 0 deletions
27
home.nix
27
home.nix
|
|
@ -429,5 +429,32 @@ in {
|
||||||
|
|
||||||
programs.starship = {
|
programs.starship = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
custom.jj = {
|
||||||
|
command = ''
|
||||||
|
jj log -r@ -n1 --ignore-working-copy --no-graph --color always -T '
|
||||||
|
separate(" ",
|
||||||
|
bookmarks.map(|x| truncate_end(10, x.name(), "…")).join(" "),
|
||||||
|
tags.map(|x| truncate_end(10, x.name(), "…")).join(" "),
|
||||||
|
surround("\"", "\"", truncate_end(24, description.first_line(), "…")),
|
||||||
|
if(conflict, "conflict"),
|
||||||
|
if(divergent, "divergent"),
|
||||||
|
if(hidden, "hidden"), )
|
||||||
|
'
|
||||||
|
'';
|
||||||
|
when = "jj root --ignore-working-copy";
|
||||||
|
symbol = "jj";
|
||||||
|
};
|
||||||
|
custom.jjstate = {
|
||||||
|
command = ''
|
||||||
|
jj log -r@ -n1 --ignore-working-copy --no-graph --stat | tail -n1 | ${pkgs.sd}/bin/sd "(\d+) files? changed, (\d+) insertions?\(\+\), (\d+) deletions?\(-\)" ' ''${1}m ''${2}+ ''${3}-' | ${pkgs.sd}/bin/sd " 0." ""
|
||||||
|
'';
|
||||||
|
when = "jj root --ignore-working-copy";
|
||||||
|
};
|
||||||
|
git_state.disabled = true;
|
||||||
|
git_commit.disabled = true;
|
||||||
|
git_metrics.disabled = true;
|
||||||
|
git_branch.disabled = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue