From fdff70515856226a01a8e4644feef8d16fe91a0b Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 24 Jan 2022 09:22:50 +0000 Subject: [PATCH] feat(zsh): use the spaceship prompt --- roles/zsh/files/.zsh/configs/plugins.zsh | 2 ++ roles/zsh/files/.zsh/configs/prompt.zsh | 45 ------------------------ roles/zsh/files/.zshenv | 3 ++ 3 files changed, 5 insertions(+), 45 deletions(-) delete mode 100644 roles/zsh/files/.zsh/configs/prompt.zsh diff --git a/roles/zsh/files/.zsh/configs/plugins.zsh b/roles/zsh/files/.zsh/configs/plugins.zsh index 6a1243e..8789700 100644 --- a/roles/zsh/files/.zsh/configs/plugins.zsh +++ b/roles/zsh/files/.zsh/configs/plugins.zsh @@ -7,4 +7,6 @@ antigen bundle zsh-users/zsh-autosuggestions antigen bundle zsh-users/zsh-completions antigen bundle zsh-users/zsh-syntax-highlighting +antigen theme spaceship-prompt/spaceship-prompt + antigen apply diff --git a/roles/zsh/files/.zsh/configs/prompt.zsh b/roles/zsh/files/.zsh/configs/prompt.zsh deleted file mode 100644 index c227372..0000000 --- a/roles/zsh/files/.zsh/configs/prompt.zsh +++ /dev/null @@ -1,45 +0,0 @@ -source /usr/lib/git-core/git-sh-prompt - -git_is_repo() { - if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == "true" ]]; then - return 1 - fi - - return 0 -} - -git_current_branch() { - echo $(git rev-parse --abbrev-ref HEAD) -} - -git_repo_is_dirty() { - if [[ -z $(git status --short) ]]; then - return 1; - fi - - return 0; -} - -git_prompt_info() { - ! git_is_repo || return - - current_branch=$(git_current_branch 2> /dev/null) - current_commit=$(git rev-parse --short HEAD 2> /dev/null) - suffix='' - - if [[ ! -z ${current_commit} ]]; then - suffix="${suffix} [%{$fg_bold[yellow]%}${current_commit}%{$reset_color%}]" - fi - - if git_repo_is_dirty; then - suffix="${suffix} %{$fg_bold[red]%}*%{$reset_color%}" - fi - - if [[ -n git_current_branch ]]; then - echo " %{$fg_bold[green]%}$(__git_ps1 %s)%{$reset_color%}${suffix}" - fi -} - -setopt promptsubst - -export PS1='${SSH_CONNECTION+"%{$fg_bold[green]%}%n@%m:"}%{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) \$ ' diff --git a/roles/zsh/files/.zshenv b/roles/zsh/files/.zshenv index 9722680..e766854 100644 --- a/roles/zsh/files/.zshenv +++ b/roles/zsh/files/.zshenv @@ -2,3 +2,6 @@ PROMPT_EOL_MARK='' TERM=xterm-256color WORDCHARS='*?_-.[]~=&;!#$%^(){}<>' ZLE_REMOVE_SUFFIX_CHARS='' + +SPACESHIP_NODE_SHOW=false +SPACESHIP_PHP_SHOW=false