Skip to content

Instantly share code, notes, and snippets.

@ryo-ARAKI
Last active April 28, 2024 23:14
Show Gist options
  • Save ryo-ARAKI/48a11585299f9032fa4bda60c9bba593 to your computer and use it in GitHub Desktop.
Save ryo-ARAKI/48a11585299f9032fa4bda60c9bba593 to your computer and use it in GitHub Desktop.
Starship configuration file
# ~/.config/starship.toml
[battery]
full_symbol = "🔋"
charging_symbol = "🔌"
discharging_symbol = "⚡"
[[battery.display]]
threshold = 30
style = "bold red"
[character]
error_symbol = "[✖](bold red) "
[cmd_duration]
min_time = 10_000 # Show command duration over 10,000 milliseconds (=10 sec)
format = " took [$duration]($style)"
[directory]
truncation_length = 5
format = "[$path]($style)[$lock_symbol]($lock_style) "
[git_branch]
format = " [$symbol$branch]($style) "
symbol = "🍣 "
style = "bold yellow"
[git_commit]
commit_hash_length = 8
style = "bold white"
[git_state]
format = '[\($state( $progress_current of $progress_total)\)]($style) '
[git_status]
conflicted = "⚔️ "
ahead = "🏎️ 💨 ×${count}"
behind = "🐢 ×${count}"
diverged = "🔱 🏎️ 💨 ×${ahead_count} 🐢 ×${behind_count}"
untracked = "🛤️ ×${count}"
stashed = "📦 "
modified = "📝 ×${count}"
staged = "🗃️ ×${count}"
renamed = "📛 ×${count}"
deleted = "🗑️ ×${count}"
style = "bright-white"
format = "$all_status$ahead_behind"
[hostname]
ssh_only = false
format = "<[$hostname]($style)>"
trim_at = "-"
style = "bold dimmed white"
disabled = true
[julia]
format = "[$symbol$version]($style) "
symbol = "ஃ "
style = "bold green"
[memory_usage]
format = "$symbol[${ram}( | ${swap})]($style) "
threshold = 70
style = "bold dimmed white"
disabled = false
[package]
disabled = true
[python]
format = "[$symbol$version]($style) "
style = "bold green"
[rust]
format = "[$symbol$version]($style) "
style = "bold green"
[time]
time_format = "%T"
format = "🕙 $time($style) "
style = "bright-white"
disabled = false
[username]
style_user = "bold dimmed blue"
show_always = false
[nodejs]
format = "via [🤖 $version](bold green) "
@pedoc
Copy link

pedoc commented Mar 25, 2022

Is it possible to display the full path of the current working directory?
If you use $directory only the last directory name will be displayed.

@jlcastrogro
Copy link

Is it possible to display the full path of the current working directory? If you use $directory only the last directory name will be displayed.

You can add to the config file:

[directory]
truncation_length = 0

@NormTurtle
Copy link

ayo anyone . i want my starship something like this what i put for that smiling face?

https://i.redd.it/zxuhsf790in91.png

@deepanchal
Copy link

Just wanted to share my organized starship config here if anyone is interested
https://gist.github.com/deepanchal/415e78646aaf5e57e10490d01ad90109

Here is what it looks like:
image

@avizyt
Copy link

avizyt commented Apr 8, 2023

How to change the region value of the prompt?

@deepanchal
Copy link

deepanchal commented Apr 8, 2023

@avizyt

How to change the region value of the prompt?

From starship docs:

The aws module shows the current AWS region and profile and an expiration timer when using temporary credentials. The output of the module uses the AWS_REGION, AWS_DEFAULT_REGION, and AWS_PROFILE env vars and the ~/.aws/config and ~/.aws/credentials files as required.

I have a default region set in my ~/.aws/config

# example config

[default]
sso_session = my-sso
sso_account_id = 111122223333
sso_role_name = readOnly
region = us-west-2 # <-- starship uses this
output = text

[profile user1]
sso_session = my-sso
sso_account_id = 444455556666
sso_role_name = readOnly
region = us-east-1
output = json

[sso-session my-sso]
sso_region = us-east-1
sso_start_url = https://my-sso-portal.awsapps.com/start
sso_registration_scopes = sso:account:access

Check this out for more details: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html

@deepanchal
Copy link

@omaru-ok

ayo anyone . i want my starship something like this what i put for that smiling face?

i.redd.it/zxuhsf790in91.png

Adding this to your starship config (~/.config/starship.toml) should give you :) / :( in your prompt.

[character]
success_symbol = '[:\)](green)' # The 'success_symbol' segment is being set to ':)' with the color 'green'
error_symbol = '[:\(](red)' # The 'error_symbol' segment is being set to ':(' with the color 'red'

image

@NormTurtle
Copy link

damn

@avizyt
Copy link

avizyt commented Apr 18, 2023

@avizyt

How to change the region value of the prompt?

From starship docs:

The aws module shows the current AWS region and profile and an expiration timer when using temporary credentials. The output of the module uses the AWS_REGION, AWS_DEFAULT_REGION, and AWS_PROFILE env vars and the ~/.aws/config and ~/.aws/credentials files as required.

I have a default region set in my ~/.aws/config

# example config

[default]
sso_session = my-sso
sso_account_id = 111122223333
sso_role_name = readOnly
region = us-west-2 # <-- starship uses this
output = text

[profile user1]
sso_session = my-sso
sso_account_id = 444455556666
sso_role_name = readOnly
region = us-east-1
output = json

[sso-session my-sso]
sso_region = us-east-1
sso_start_url = https://my-sso-portal.awsapps.com/start
sso_registration_scopes = sso:account:access

Check this out for more details: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html

Thank you.

@SanjidChowdhury
Copy link

SanjidChowdhury commented Aug 19, 2023

Hi, how can i make it so that my directory shows like "Dashboard > resources" instead of "Dashboard/resources"? I am using the nerd-font-symbols preset. Also, as this is in VSCode, I want to show the full directory to "Dashboard". Putting the code in the config below does not work.

[directory]
truncation_length = 0
read_only = " 󰌾"

image

@muscaiu
Copy link

muscaiu commented Nov 18, 2023

[nodejs] format = 'via [🤖 $version](bold green) '

it will show the git status, but not the Node version

Any idea why?

Screenshot 2023-11-18 at 16 07 55

@plsnotracking
Copy link

Hi,

Thank you for sharing this, I'm pretty new to starship. I've moved from basic .zsh terminal to starship.

I wanted to port my .zshrc configuration to starship, couldn't find proper documentation to follow.

Kind of looking for equivalents of doing aliases. For example:

## cat
alias bat='bat --theme=ansi-dark'
command -v bat > /dev/null && alias cat='bat --pager=never'

## du
command -v dust > /dev/null && alias du='dust'

## find
command -v fd > /dev/null && alias find='fd'

## fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

## git aliases and functions
source $HOME/.config/zsh/git.zsh

## history
source $HOME/.config/zsh/history.zsh

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment