Last active
June 4, 2024 16:08
-
-
Save K4R7IK/3d61ac593c812646b72cf44678841eeb to your computer and use it in GitHub Desktop.
Startship prompt configuration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Left prompt | |
format = """ | |
$directory\ | |
${custom.git_host}\ | |
$git_branch\ | |
$git_commit\ | |
$git_state\ | |
$git_status\ | |
${custom.lastcommit}\ | |
$all\ | |
$line_break\ | |
$character\ | |
""" | |
# Right prompt | |
right_format = """ | |
$cmd_duration\ | |
${custom.file_number}\ | |
${custom.folder_number}\ | |
${custom.df}\ | |
""" | |
scan_timeout = 10 | |
add_newline = true | |
[character] | |
vimcmd_symbol = '[](bright-yellow)' | |
success_symbol = '[❯](bright-green)' | |
error_symbol = '[✗](bright-red)' | |
[cmd_duration] | |
min_time_to_notify = 60_000 | |
min_time = 2_000 | |
format = ' [$duration](bold yellow)' | |
[directory] | |
truncation_length = 5 | |
format = '[$path]($style)[$read_only]($read_only_style)' | |
read_only = ' ' | |
[directory.substitutions] | |
'~/Downloads' = ' ' | |
'~/Documents' = ' ' | |
'~/Music' = ' ' | |
'~/Pictures' = ' ' | |
'~/Videos' = ' ' | |
'~/Desktop' = ' ' | |
'~/Projects' = ' ' | |
'~/Games' = ' ' | |
[fill] | |
symbol = ' ' | |
disabled = true | |
[lua] | |
symbol=' ' | |
[line_break] | |
disabled = false | |
[git_branch] | |
format = ':[$symbol$branch]($style)' | |
symbol = ' ' | |
style = '#a8b2fc bold' | |
[git_state] | |
format = '\(:[$state( $progress_current/$progress_total)]($style)\)' | |
[git_status] | |
format = '(:[$all_status$ahead_behind]($style)) ' | |
conflicted = '\[ [$count](bright-white bold)\]' | |
ahead = '\[[﯁ ](bright-blue)[$count](bright-white bold)\]' | |
behind = '\[[﮾ ](white)[$count](bright-white bold)\]' | |
diverged = '\[[ ](purple)|[ ﯁ ](bright-blue)[$ahead_count](bright-white bold)[ ﮾ ](white)[$behind_count](bright-white)\]' | |
untracked = '\[ [$count](bright-white bold)\]' | |
stashed = '\[[](yellow) [$count](bright-white bold)\]' | |
modified = '\[[ ](bright-yellow)[$count](bright-white bold)\]' | |
staged = '\[[ ](bright-green)[$count](bright-white bold)\]' | |
renamed = '\[[ ](bright-cyan) [$count](bright-white bold)\]' | |
deleted = '\[ [$count](bright-white bold)\]' | |
[python] | |
format = 'via [${symbol}${pyenv_prefix}(${version} )(\($virtualenv\) )]($style)' | |
[custom.git_host] | |
command = """ | |
URL=$(command git ls-remote --get-url 2> /dev/null) | |
if [[ "$URL" =~ "github" ]]; then | |
ICON=" " | |
elif [[ "$URL" =~ "gitlab" ]]; then | |
ICON=" " | |
elif [[ "$URL" =~ "bitbucket" ]];then | |
ICON=" " | |
elif [[ "$URL" =~ "kernel" ]];then | |
ICON=" " | |
elif [[ "$URL" =~ "archlinux" ]];then | |
ICON=" " | |
elif [[ "$URL" =~ "gnu" ]];then | |
ICON=" " | |
elif [[ "$URL" =~ "git" ]];then | |
ICON=" " | |
else | |
ICON=" " | |
URL="localhost" | |
fi | |
for PATTERN in "https" "http" "git" "://" "@"; do | |
[[ "$URL" == "$PATTERN"* ]] && URL="${URL##$PATTERN}" | |
done | |
for PATTERN in "/" ".git"; do | |
[[ "$URL" == *"$PATTERN" ]] && URL="${URL%%$PATTERN}" | |
done | |
printf "%s%s" "$ICON" "$URL" | |
""" | |
directories = [".git"] | |
when = 'git rev-parse --is-inside-work-tree 2> /dev/null' | |
shell = ["bash","--norc","--noprofile"] | |
style = "#f08080 bold" | |
format = ' at [$output]($style)' | |
[custom.lastcommit] | |
description = 'Display last commit hash and message' | |
command = "git show -s --format='%h \"%s\"'" | |
when = "git rev-parse --is-inside-work-tree 2> /dev/null" | |
style = '#fd9f9f bold' | |
format = '[$output]($style) ' | |
[custom.df] | |
command = "df -h --output=avail '$PWD' | tail -n 1" | |
when = 'true' | |
shell = ['bash', '--noprofile', '--norc'] | |
symbol = '' | |
format = '[$symbol ($output)]($style) ' | |
style = 'bright-blue' | |
disabled = true | |
[custom.file_number] | |
disabled = true | |
command = "find . -maxdepth 1 -type f -not -name '.DS_Store' | wc -l" | |
when = 'exit 0' # run always | |
symbol = ' ' | |
description = 'Number of files in the current working directory' | |
format = '[$symbol$output]($style) ' | |
style = 'bright-blue' | |
[custom.folder_number] | |
disabled = true | |
command = "find . -maxdepth 1 -type d -not -name '.git' -not -name '.' | wc -l" | |
when = 'exit 0' | |
symbol = ' ' | |
description = 'Number of folders in the current working directory' | |
format = '[$symbol$output]($style) ' | |
style = 'bright-blue' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment