From fa33c1b0145c8f9a51926f3093c75955fdcf6102 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Wed, 10 Feb 2021 23:24:39 +0100 Subject: [PATCH] zsh: Add starship support --- dotfiles/shell/.zshrc | 10 ++++++++++ dotfiles/shell/starship.toml | 11 +++++++++++ 2 files changed, 21 insertions(+) create mode 100644 dotfiles/shell/starship.toml diff --git a/dotfiles/shell/.zshrc b/dotfiles/shell/.zshrc index 4e135a9..36d46fd 100644 --- a/dotfiles/shell/.zshrc +++ b/dotfiles/shell/.zshrc @@ -70,6 +70,16 @@ SAVEHIST=50000 REPORTTIME=5 TIMEFMT="$fg[magenta]%J %U user %S sys %P cpu %*E total %M MB RSS max$terminfo[sgr0]" + +# Load starship if exists, and that's it. +if [ $TERM != "linux" ] && type "starship" > /dev/null; then + eval "$(starship init zsh)" + return +fi + + +# Otherwise, do some homebrewn configuration + autoload -Uz vcs_info && vcs_info zstyle ':vcs_info:*' enable git cvs svn hg zstyle ':vcs_info:*' use-prompt-escapes diff --git a/dotfiles/shell/starship.toml b/dotfiles/shell/starship.toml new file mode 100644 index 0000000..40df2e8 --- /dev/null +++ b/dotfiles/shell/starship.toml @@ -0,0 +1,11 @@ +[directory] +truncate_to_repo = false +style = "bold blue" +truncation_length = 5 +truncation_symbol = "…" + +[username] +style_user = "bold green" + +[git_branch] +style = "bold yellow" -- 2.30.2