Skip to content

Commit

Permalink
Merge pull request #300 from izumin5210/izumin5210/starship
Browse files Browse the repository at this point in the history
use starship
  • Loading branch information
izumin5210 authored Mar 30, 2024
2 parents 37eb99b + da58edd commit f65d2db
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 143 deletions.
1 change: 1 addition & 0 deletions bin/deploy-config-files
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ mkdir -p ~/.config
# zsh
mkdir -p ~/.config/zsh
./bin/ln-idempotently ./config/.config/zsh/legacy ~/.config/zsh/legacy
./bin/ln-idempotently ./config/.config/starship.toml ~/.config/starship.toml

# vim
./bin/ln-idempotently ./config/.config/nvim ~/.config/nvim
Expand Down
2 changes: 2 additions & 0 deletions bin/setup-codespace
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ apt install -y \
fzf \
ripgrep \
tig

curl -sS https://starship.rs/install.sh | sh -s -- -y
72 changes: 72 additions & 0 deletions config/.config/starship.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
"$schema" = 'https://starship.rs/config-schema.json'

add_newline = true

format = """
${custom.git_repo}\
$directory\
$git_status\
$git_state\
$git_branch\
$git_commit\
$git_state\
$jobs\
$status\
$cmd_duration\
$line_break\
$shell\
$character"""

[character]
success_symbol = '[:\)](green)'
error_symbol = '[:\(](red)'

[package]
disabled = true

[directory]
truncate_to_repo = false
truncation_length = 100
format = '[$path ]($style)[$read_only]($read_only_style)'
style = 'blue'
repo_root_format = '[($path )]($style)[$read_only]($read_only_style)[-](black) '
repo_root_style = 'blue'

[custom.git_repo]
when = true
require_repo = true
command = 'git rev-parse --show-toplevel | sed -e "s,$(ghq root)/\(github\.com/\)\?,,"'
style = 'bold blue'

[git_status]
format = '([$all_status$ahead_behind]($style) )'
ahead = '[⇡$ahead_count](red)'
behind = '[⇣$behind_count](cyan)'
modified = '[ ](yellow)'
deleted = '[󱎘 ](red)'
untracked = '[ ](red)'
staged = '[󰸞 ](green)'
stashed ='[󰉀 ](cyan)'

[git_state]
format = '\([$state( $progress_current/$progress_total)]($style)\) '
style = 'bold red'

[git_branch]
format = '[[$symbol](black)$branch(:$remote_branch) ]($style)'
symbol = ''
style = 'bold black'

[jobs]
number_threshold = 1
style = 'purple'

[status]
format = '[[-](black) $status( SIG$signal_name)]($style) '
disabled = false
style = 'red'

[cmd_duration]
format = '[[-](black) 󱦟 $duration]($style) '
style = 'yellow'
min_time = 10_000
2 changes: 1 addition & 1 deletion config/.config/zsh/legacy/.zshenv
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if [ -d "${HOME}/.pyenv" ]; then
fi

if type fnm >/dev/null 2>&1; then
eval "$(fnm env --use-on-cd)"
eval "$(fnm env --use-on-cd --log-level error)"
fi

# jenv
Expand Down
2 changes: 1 addition & 1 deletion config/.config/zsh/legacy/.zshrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
bindkey -e
autoload -Uz add-zsh-hook
source $HOME/.config/zsh/legacy/prompt.zsh
source $HOME/.config/zsh/legacy/functions.zsh
source $HOME/.config/zsh/legacy/fzf.zsh

Expand Down Expand Up @@ -79,3 +78,4 @@ if [ -f /Users/izumin/.travis/travis.sh ]; then
fi

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
eval "$(starship init zsh)"
141 changes: 0 additions & 141 deletions config/.config/zsh/legacy/prompt.zsh

This file was deleted.

1 change: 1 addition & 0 deletions home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
pkgs.jq
pkgs.mas # only darwin
pkgs.ripgrep
pkgs.starship
pkgs.tig
pkgs.tree

Expand Down

0 comments on commit f65d2db

Please sign in to comment.