From 2963ec0ad4167457f1355ba84d1f01986c437cd2 Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Mon, 28 Mar 2022 13:28:38 +0200 Subject: [PATCH] Add starship prompt --- .bashrc | 7 ++-- .config/locale.conf | 14 ++++++-- .config/starship.toml | 80 +++++++++++++++++++++++++++++++++++++++++++ .config/zsh/.zshrc | 11 +++--- 4 files changed, 102 insertions(+), 10 deletions(-) create mode 100644 .config/starship.toml diff --git a/.bashrc b/.bashrc index 64fd4b1..ae59455 100644 --- a/.bashrc +++ b/.bashrc @@ -11,6 +11,7 @@ fi # Set name of the theme to load. Optionally, if you set this to "random" # it'll load a random theme each time that oh-my-bash is loaded. OSH_THEME="brainy" +[ -x "$(command -v starship)" ] && ZSH_THEME="" # Uncomment the following line to use case-sensitive completion. # CASE_SENSITIVE="true" @@ -29,10 +30,10 @@ OSH_THEME="brainy" # DISABLE_LS_COLORS="true" # Uncomment the following line to disable auto-setting terminal title. -# DISABLE_AUTO_TITLE="true" +DISABLE_AUTO_TITLE="true" # Uncomment the following line to enable command auto-correction. -# ENABLE_CORRECTION="true" +ENABLE_CORRECTION="true" # Uncomment the following line to display red dots whilst waiting for completion. # COMPLETION_WAITING_DOTS="true" @@ -88,3 +89,5 @@ shopt -s checkwinsize source "$HOME/.config/environment" [ -f "$HOME/.config/aliasrc" ] && source "$HOME/.config/aliasrc" [ -x "$(command -v thefuck)" ] && eval $(thefuck --alias) + +[ -x "$(command -v starship)" ] && eval "$(starship init bash)" diff --git a/.config/locale.conf b/.config/locale.conf index 666d107..1cbbf3e 100644 --- a/.config/locale.conf +++ b/.config/locale.conf @@ -1,4 +1,12 @@ -LANG=en_DE.UTF-8 -LANGUAGE=en_DE:en_IE:en_GB:en -LC_ALL= +LANG=en_US.UTF-8 +LANGUAGE=en_US LC_COLLATE=C +LC_TIME=de_DE.UTF-8 +LC_MONETARY=de_DE.UTF-8 +LC_NUMERIC=de_DE.UTF-8 +LC_PAPER=de_DE.UTF-8 +LC_MEASUREMENT=de_DE.UTF-8 +LC_NAME=de_DE.UTF-8 +LC_ADDRESS=de_DE.UTF-8 +LC_TELEPHONE=de_DE.UTF-8 +LC_ALL= diff --git a/.config/starship.toml b/.config/starship.toml new file mode 100644 index 0000000..fc46002 --- /dev/null +++ b/.config/starship.toml @@ -0,0 +1,80 @@ +format = """ +$time $username$hostname$docker_context $directory$git_branch$git_commit$git_state$git_status\ +$fill$status$cmd_duration$jobs +$sudo$shell $character +""" + +continuation_prompt = "▶" + + +[character] +success_symbol = "[➜](bold green)" +error_symbol = "[✗](bold red)" +vicmd_symbol = "[V](bold green)" + +[cmd_duration] +min_time = 0 +show_notifications = true +show_milliseconds = true +format = "[祥$duration]($style) " + +[directory] +read_only = "" +truncation_length = 8 +truncation_symbol = "…/" +style = "cyan" +repo_root_style = "cyan bold underline" +format = "[$read_only]($read_only_style)[$path]($style) " +repo_root_format = "[$read_only]($read_only_style)[$before_root_path]($style)[$repo_root]($repo_root_style)[$path]($style) " + +[docker_context] +format = ' [\[$symbol$context\]]($style)' + +[fill] +symbol = " " + +[git_commit] +tag_disabled = false +tag_symbol = " " + +[git_status] +staged = "[+](green)" + +[hostname] +ssh_only = false +style = "purple" +format = "@[$hostname]($style)" +trim_at = "" + +[jobs] +number_threshold = 1 +symbol = "" + +[shell] +bash_indicator = '\$' +fish_indicator = "" +zsh_indicator = '%%' +powershell_indicator = "" +unknown_indicator = "" +style = "white" +format = '[$indicator]($style)' +disabled = false + +[sudo] +format = "[$symbol]($style)" +disabled = false + +[status] +disabled = false +format = "[$status]($style) " + +[time] +disabled = false +style = "white" +format = "[$time]($style)" + +[username] +style_user = "yellow bold" +style_root = "red bold" +format = "[$user]($style)" +show_always = true diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index ff90c08..3d41f60 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -12,6 +12,7 @@ fi # to know which specific one was loaded, run: echo $RANDOM_THEME # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes ZSH_THEME="serguzim" +[ -x "$(command -v starship)" ] && ZSH_THEME="" # Set list of themes to pick from when loading at random # Setting this variable when ZSH_THEME=random will cause zsh to load @@ -42,10 +43,10 @@ DISABLE_AUTO_UPDATE="false" # DISABLE_LS_COLORS="true" # Uncomment the following line to disable auto-setting terminal title. -# DISABLE_AUTO_TITLE="true" +DISABLE_AUTO_TITLE="true" # Uncomment the following line to enable command auto-correction. -# ENABLE_CORRECTION="true" +ENABLE_CORRECTION="true" # Uncomment the following line to display red dots whilst waiting for completion. # COMPLETION_WAITING_DOTS="true" @@ -61,7 +62,7 @@ DISABLE_AUTO_UPDATE="false" # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" # or set a custom format using the strftime function format specifications, # see 'man strftime' for details. -# HIST_STAMPS="yyyy-mm-dd" +HIST_STAMPS="yyyy-mm-dd" # Would you like to use another custom folder than $ZSH/custom? ZSH_CUSTOM=$ZDOTDIR/custom @@ -78,11 +79,9 @@ plugins=( 'cp' 'docker' 'docker-compose' - 'encode64' 'extract' 'git' 'git-auto-status' - 'httpie' 'jump' 'laravel5' 'rust' @@ -108,3 +107,5 @@ export HISTFILE="$HOME/.cache/zsh_history" # Load zsh-syntax-highlighting; should be last. source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null + +[ -x "$(command -v starship)" ] && eval "$(starship init zsh)"