Skip to content

Instantly share code, notes, and snippets.

@syrm
Created September 3, 2025 07:15
Show Gist options
  • Select an option

  • Save syrm/2bebf105f442ab3fb40a4d9fa2f78f27 to your computer and use it in GitHub Desktop.

Select an option

Save syrm/2bebf105f442ab3fb40a4d9fa2f78f27 to your computer and use it in GitHub Desktop.
JJ prompt for Starship
# .config/starship-jj/starship-jj.toml
# cargo install starship-jj --locked
module_separator = " "
reset_color = true
[bookmarks]
search_depth = 100
exclude = []
[[module]]
type = "Bookmarks"
separator = " on "
color = "Magenta"
behind_symbol = "🠕"
surround_with_quotes = false
[[module]]
type = "Commit"
max_length = 30
empty_text = "D"
surround_with_quotes = false
[[module]]
type = "State"
separator = " "
[module.empty]
disabled = false
text = "C"
color = "Yellow"
[module.conflict]
disabled = false
text = "(CONFLICT)"
color = "Red"
[module.divergent]
disabled = false
text = "(DIVERGENT)"
color = "Cyan"
[module.immutable]
disabled = false
text = "(IMMUTABLE)"
color = "Yellow"
[module.hidden]
disabled = false
text = "(HIDDEN)"
color = "Yellow"
[[module]]
type = "Metrics"
template = "[{changed} {added}{removed}]"
color = "Magenta"
[module.changed_files]
prefix = ""
suffix = ""
color = "Cyan"
# .config/starship.toml
"$schema" = 'https://starship.rs/config-schema.json'
add_newline = false
format = """
$username\
$hostname\
$localip\
$shlvl\
$directory\
${custom.git_branch}\
${custom.git_commit}\
${custom.git_state}\
${custom.git_metrics}\
${custom.git_status}\
${custom.jj}\
$direnv\
$env_var\
$custom\
$sudo\
$cmd_duration\
$line_break\
$jobs\
$battery\
$status\
$container\
$shell\
$character"""
[character]
success_symbol = '[➜](bold green) '
error_symbol = '[➜](bold red) '
[custom.jj]
command = "prompt"
format = "$output"
ignore_timeout = true
shell = ["starship-jj", "--ignore-working-copy", "starship"]
use_stdin = false
when = true
[git_status]
disabled = true
[custom.git_status]
when = "! jj --ignore-working-copy root"
command = "starship module git_status"
style = "" # This disables the default "(bold green)" style
description = "Only show git_status if we're not in a jj repo"
[git_commit]
disabled = true
[custom.git_commit]
when = "! jj --ignore-working-copy root"
command = "starship module git_commit"
style = ""
description = "Only show git_commit if we're not in a jj repo"
[git_metrics]
disabled = true
[custom.git_metrics]
when = "! jj --ignore-working-copy root"
command = "starship module git_metrics"
description = "Only show git_metrics if we're not in a jj repo"
style = ""
[git_branch]
disabled = true
[custom.git_branch]
when = "! jj --ignore-working-copy root"
command = "starship module git_branch"
description = "Only show git_branch if we're not in a jj repo"
style = ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment