From 5ddf2c8fb77e1f13ef99e9d4b79776d5b6214c6c Mon Sep 17 00:00:00 2001 From: Severin Kaderli Date: Mon, 24 Aug 2020 17:08:56 +0200 Subject: [PATCH] Use starship for prompt Signed-off-by: Severin Kaderli --- system/.config/custom/env | 32 +++++++++++++++-------------- system/.config/starship/config.toml | 28 +++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 15 deletions(-) create mode 100644 system/.config/starship/config.toml diff --git a/system/.config/custom/env b/system/.config/custom/env index 973b016..f6f76a7 100644 --- a/system/.config/custom/env +++ b/system/.config/custom/env @@ -65,6 +65,7 @@ export PSQLRC="${XDG_CONFIG_HOME}/pg/psqlrc" export PSQL_HISTORY="${XDG_CACHE_HOME}/pg/psql_history" export PGPASSFILE="${XDG_CONFIG_HOME}/pg/pgpass" export PGSERVICEFILE="${XDG_CONFIG_HOME}/pg/pg_service.conf" +export STARSHIP_CONFIG="${XDG_CONFIG_HOME}/starship/config.toml" export OCTAVE_HISTFILE="${XDG_CACHE_HOME}/octave-hist" export OCTAVE_SITE_INITFILE="${XDG_CONFIG_HOME}/octave/octaverc" mkdir -p "${XDG_CONFIG_HOME}/bazaar" @@ -95,9 +96,9 @@ export CLION_JDK="${IDEA_JDK}" export ZDOTDIR="${XDG_CONFIG_HOME}/zsh" export HISTFILE="${XDG_DATA_HOME}/zsh/history" export HISTCONTROL=ignoreboth -export SAVEHIST=1000 -export HISTSIZE=1000 -export HISTFILESIZE=2000 +export HISTSIZE=10000 +export SAVEHIST="${HISTSIZE}" +export HISTFILESIZE="${HISTSIZE}" mkdir -p "${XDG_DATA_HOME}/zsh/zcompdump-${ZSH_VERSION}" if [ -n "$(command -v compinit)" ]; then @@ -174,15 +175,16 @@ function precmd() { } # Custom prompt -NEWLINE=$'\n' -export PS1="┌─" -export PS1="${PS1}%F{red}[%D{%T}]%f" -export PS1="${PS1}%F{blue}[%m]%f" -export PS1="${PS1}%F{yellow}[%~]%f" -export PS1="${PS1}"'${(r:$(prompt_width)::─:)}' -export PS1="${PS1}%F{yellow}"'$(file_count)'"%f" -export PS1="${PS1}%F{blue}"'$(folder_size)'"%f" -export PS1="${PS1}%F{red}"'$(current_branch)'"%f" -export PS1="${PS1}─┐" -export PS1="${PS1}${NEWLINE}└─╼ " -export RPROMPT="╾─┘" \ No newline at end of file +#NEWLINE=$'\n' +#export PS1="┌─" +#export PS1="${PS1}%F{red}[%D{%T}]%f" +#export PS1="${PS1}%F{blue}[%m]%f" +#export PS1="${PS1}%F{yellow}[%~]%f" +#export PS1="${PS1}"'${(r:$(prompt_width)::─:)}' +#export PS1="${PS1}%F{yellow}"'$(file_count)'"%f" +#export PS1="${PS1}%F{blue}"'$(folder_size)'"%f" +#export PS1="${PS1}%F{red}"'$(current_branch)'"%f" +#export PS1="${PS1}─┐" +#export PS1="${PS1}${NEWLINE}└─╼ " +#export RPROMPT="╾─┘" +eval "$(starship init zsh)" \ No newline at end of file diff --git a/system/.config/starship/config.toml b/system/.config/starship/config.toml new file mode 100644 index 0000000..5fb6995 --- /dev/null +++ b/system/.config/starship/config.toml @@ -0,0 +1,28 @@ +# Don't print a new line at the start of the prompt +add_newline = false +prompt_order = [ + "time", + "directory", + "git_branch", + "line_break", + "character" +] + +# Replace the "❯" symbol in the prompt with "➜" +[character] # The name of the module we are configuring is "character" +symbol = "➜" # The "symbol" segment is being set to "➜" + +[directory] +truncate_to_repo = false + +[hostname] +ssh_only = false + +[time] +disabled = false + +[username] +show_always = true + +[git_branch] +symbol = "" \ No newline at end of file