Skip to content

Commit fc6f7ba

Browse files
authored
Merge pull request #263 from djensenius/additions
Additions
2 parents a1486f5 + d2ff719 commit fc6f7ba

3 files changed

Lines changed: 29 additions & 1 deletion

File tree

mise/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ zig = 'latest'
3131
"cargo:cargo-hack" = "latest"
3232
"cargo:cargo-minimal-versions" = "latest"
3333
"cargo:cargo-update" = "latest"
34+
"cargo:starship-jj" = "latest"
3435

3536
## Go packages
3637
"go:github.com/Gelio/go-global-update" = "latest"

starship.toml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ command_timeout = 5000
88
# left prompt
99
format = """$battery$hostname$container$os$directory$character"""
1010
# move the rest of the prompt to the right
11-
right_format = """$all"""
11+
right_format = """$all${custom.jj_branch}${custom.jj_op}${custom.jj_git_notinsync}"""
1212

1313
[aws]
1414
disabled = true
@@ -416,3 +416,26 @@ surface0 = "#363a4f"
416416
base = "#24273a"
417417
mantle = "#1e2030"
418418
crust = "#181926"
419+
420+
[custom.jj_branch]
421+
when = "jj workspace root --ignore-working-copy > /dev/null 2>&1"
422+
command = '''
423+
jj log -r "(immutable_heads()..@):: & branches()" -T 'local_branches.join(\"\n\") ++ \"\n\"' --no-graph --ignore-working-copy | head -n 1
424+
'''
425+
style = 'yellow'
426+
427+
[custom.jj_op]
428+
when = "jj workspace root --ignore-working-copy > /dev/null 2>&1"
429+
command = 'jj op log -n 1 -T "id.short()" --no-graph --ignore-working-copy'
430+
symbol = 'op:'
431+
style = "bright-yellow"
432+
433+
[custom.jj_git_notinsync]
434+
when = '''
435+
[ -n "${jj_git_head:=$(jj log -T commit_id --no-graph --ignore-working-copy -r HEAD@git)}" ] \
436+
&& [ -n "${git_head:=$(git rev-parse HEAD)}" ] \
437+
&& [ "$git_head" != "$jj_git_head" ]
438+
'''
439+
command = 'jj log -T "commit_id.short()" --no-graph --ignore-working-copy -r HEAD@git'
440+
symbol = 'jj:git≠'
441+
style = 'bold red'

tmux/tmux-nerd-font-window-name.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ icons:
66
bat: "󰭟"
77
btm: ""
88
console: "󰞷"
9+
gitui: ""
910
gh: ""
1011
gping: ""
12+
jj: ""
13+
lazygit: ""
14+
lazyjj: ""
1115
nvim: ""
1216
tickrs: ""
1317
unicorn: "󱗃"

0 commit comments

Comments
 (0)