dotfiles

*nix config files
git clone git://git.pyratebeard.net/dotfiles.git
Log | Files | Refs | README

commit 6b15dbffe393351a65206167aefed5a580b6eb3f
parent 923cf86fd45a334eee9b862004e207d06cf9e287
Author: dudley <root@pyratebeard.net>
Date:   Fri, 14 Jul 2017 21:02:24 +0100

moved all prompts into one prompt file

Diffstat:
Dzsh/.zsh/dual-line-prompt._zsh | 19-------------------
Dzsh/.zsh/minimal-git-prompt.zsh | 56--------------------------------------------------------
Dzsh/.zsh/minimal-prompt.zsh | 14--------------
Mzsh/.zsh/prompt.zsh | 80++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------
Dzsh/.zsh/single-line-git-prompt.zsh | 105-------------------------------------------------------------------------------
5 files changed, 59 insertions(+), 215 deletions(-)

diff --git a/zsh/.zsh/dual-line-prompt._zsh b/zsh/.zsh/dual-line-prompt._zsh @@ -1,19 +0,0 @@ -# ██ -# ░██ -# ██████ ██████░██ -# ░░░░██ ██░░░░ ░██████ -# ██ ░░█████ ░██░░░██ -# ██ ░░░░░██░██ ░██ -# ██████ ██████ ░██ ░██ -# ░░░░░░ ░░░░░░ ░░ ░░ -# -# ▓▓▓▓▓▓▓▓▓▓ -# ░▓ author ▓ xero <x@xero.nu> -# ░▓ code ▓ http://code.xero.nu/dotfiles -# ░▓ mirror ▓ http://git.io/.files -# ░▓▓▓▓▓▓▓▓▓▓ -# ░░░░░░░░░░ -# -#█▓▒░dual line prompt -PROMPT='${USER_LEVEL}┌[%F{white}%n@%M${USER_LEVEL}]─[%F{white}%~${USER_LEVEL}]$(prompt_git_info) -${USER_LEVEL}└─ - %F{white}' diff --git a/zsh/.zsh/minimal-git-prompt.zsh b/zsh/.zsh/minimal-git-prompt.zsh @@ -1,56 +0,0 @@ -# '########::'######::'##::::'##: -# ..... ##::'##... ##: ##:::: ##: -# :::: ##::: ##:::..:: ##:::: ##: -# ::: ##::::. ######:: #########: -# :: ##::::::..... ##: ##.... ##: -# : ##::::::'##::: ##: ##:::: ##: -# ########:. ######:: ##:::: ##: -# ........:::......:::..:::::..:: -# -# AUTHOR pyratebeard <root@pyratebeard.net> -# CODE http://github.com/pyratebeard/dotfiles -# -setopt PROMPT_SUBST -#???? colors for permissions -if [[ "$EUID" -ne "0" ]] -then # if user is not root - USER_LEVEL="${COLOR_USER}" -else # root! - USER_LEVEL="${COLOR_ROOT}" -fi - -GIT_PROMPT() { - test=$(git rev-parse --is-inside-work-tree 2> /dev/null) - if [ ! "$test" ] - then - case "$PROMPT_STYLE" in - ascii) - echo "$reset_color%F{cyan}??" - ;; - arrows) - echo "$reset_color%F{cyan}?" - ;; - esac - return - fi - ref=$(git name-rev --name-only HEAD | sed 's!remotes/!!' 2> /dev/null) - dirty="" && [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]] && dirty=$ICO_DIRTY - stat=$(git status | sed -n 2p) - case "$stat" in - *ahead*) - stat=$ICO_AHEAD - ;; - *behind*) - stat=$ICO_BEHIND - ;; - *diverged*) - stat=$ICO_DIVERGED - ;; - *) - stat="" - ;; - esac - echo "${USER_LEVEL}[${COLOR_NORMAL}"${ref}${dirty}${stat}"${USER_LEVEL}] " -} -# Minimal prompt -PROMPT='%F{cyan}${USERNAME}@%F{white}[archee] $(GIT_PROMPT): %~# ' diff --git a/zsh/.zsh/minimal-prompt.zsh b/zsh/.zsh/minimal-prompt.zsh @@ -1,14 +0,0 @@ -# '########::'######::'##::::'##: -# ..... ##::'##... ##: ##:::: ##: -# :::: ##::: ##:::..:: ##:::: ##: -# ::: ##::::. ######:: #########: -# :: ##::::::..... ##: ##.... ##: -# : ##::::::'##::: ##: ##:::: ##: -# ########:. ######:: ##:::: ##: -# ........:::......:::..:::::..:: -# -# AUTHOR pyratebeard <root@pyratebeard.net> -# CODE http://github.com/pyratebeard/dotfiles -# -# Minimal prompt -PROMPT='%F{cyan}${USERNAME}@%F{white}[archee] : %~# ' diff --git a/zsh/.zsh/prompt.zsh b/zsh/.zsh/prompt.zsh @@ -1,40 +1,47 @@ -# '########::'######::'##::::'##: -# ..... ##::'##... ##: ##:::: ##: -# :::: ##::: ##:::..:: ##:::: ##: -# ::: ##::::. ######:: #########: -# :: ##::::::..... ##: ##.... ##: -# : ##::::::'##::: ##: ##:::: ##: -# ########:. ######:: ##:::: ##: -# ........:::......:::..:::::..:: -# -# AUTHOR pyratebeard <root@pyratebeard.net> -# CODE http://github.com/pyratebeard/dotfiles -# +#ICO_DIRTY="⚡" +#ICO_DIRTY="↯" +ICO_DIRTY="*" +#ICO_AHEAD="↑" +ICO_AHEAD="🠙" +#ICO_AHEAD="▲" +#ICO_BEHIND="↓" +ICO_BEHIND="🠛" +#ICO_BEHIND="▼" +ICO_DIVERGED="⥮" +COLOR_ROOT="%F{red}" +COLOR_USER="%F{cyan}" +COLOR_NORMAL="%F{white}" +PROMPT_STYLE="classic" + +#█▓▒░ allow functions in the prompt setopt PROMPT_SUBST -#???? colors for permissions +autoload -Uz colors && colors + +#█▓▒░ colors for permissions if [[ "$EUID" -ne "0" ]] then # if user is not root - USER_LEVEL="${COLOR_USER}" + USER_LEVEL="${COLOR_USER}" else # root! - USER_LEVEL="${COLOR_ROOT}" + USER_LEVEL="${COLOR_ROOT}" fi +#█▓▒░ git prompt GIT_PROMPT() { test=$(git rev-parse --is-inside-work-tree 2> /dev/null) if [ ! "$test" ] then case "$PROMPT_STYLE" in ascii) - echo "$reset_color%F{cyan}??" + echo "$reset_color%F{cyan}▒░" ;; arrows) - echo "$reset_color%F{cyan}?" + echo "$reset_color%F{cyan}" ;; esac return fi ref=$(git name-rev --name-only HEAD | sed 's!remotes/!!' 2> /dev/null) - dirty="" && [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]] && dirty=$ICO_DIRTY + dirty="" && [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]] && dirty=$ICO_DIRTY stat=$(git status | sed -n 2p) case "$stat" in *ahead*) @@ -50,7 +57,38 @@ GIT_PROMPT() { stat="" ;; esac - echo "${USER_LEVEL}[${COLOR_NORMAL}"${ref}${dirty}${stat}"${USER_LEVEL}] " + case "$PROMPT_STYLE" in + ninja) + echo "${COLOR_NORMAL}${ref}${dirty}${stat}" + ;; + ascii) + echo "%{$bg[magenta]%}%F{cyan}▓▒░ %F{black}${ref}${dirty}${stat} $reset_color%F{magenta}▒░" + ;; + arrows) + echo "%{$bg[magenta]%}%F{cyan} %F{black}${ref}${dirty}${stat} $reset_color%F{magenta}" + ;; + *) + echo "${USER_LEVEL}─[${COLOR_NORMAL}"${ref}${dirty}${stat}"${USER_LEVEL}]" + ;; + esac } -# Minimal prompt -PROMPT='%F{cyan}${USERNAME}@%F{white}[archee] $(GIT_PROMPT): %~# ' +case "$PROMPT_STYLE" in +# ascii +ascii) +PROMPT='%{$bg[cyan]%} %F{black}%~ $(GIT_PROMPT)$reset_color +%f' +;; +# dual line +dual) +PROMPT='${USER_LEVEL}┌[${COLOR_NORMAL}%~${USER_LEVEL}]$(GIT_PROMPT) +${USER_LEVEL}└─ - %f' +;; +# mini +mini) +PROMPT='${USER_LEVEL}[${COLOR_NORMAL}%~${USER_LEVEL}]$(GIT_PROMPT)── - %f' +;; +# classic +*) +PROMPT='%F{cyan}${USERNAME}@%F{white}[archee]$(GIT_PROMPT)%F{white} : %~# ' +;; +esac diff --git a/zsh/.zsh/single-line-git-prompt.zsh b/zsh/.zsh/single-line-git-prompt.zsh @@ -1,105 +0,0 @@ -#ICO_DIRTY="⚡" -#ICO_DIRTY="↯" -ICO_DIRTY="*" -#ICO_AHEAD="↑" -ICO_AHEAD="🠙" -#ICO_AHEAD="▲" -#ICO_BEHIND="↓" -ICO_BEHIND="🠛" -#ICO_BEHIND="▼" -ICO_DIVERGED="⥮" -COLOR_ROOT="%F{red}" -COLOR_USER="%F{cyan}" -COLOR_NORMAL="%F{white}" -PROMPT_STYLE="classic" - - -#█▓▒░ allow functions in the prompt -setopt PROMPT_SUBST -autoload -Uz colors && colors - -#█▓▒░ colors for permissions -if [[ "$EUID" -ne "0" ]] -then # if user is not root - USER_LEVEL="${COLOR_USER}" -else # root! - USER_LEVEL="${COLOR_ROOT}" -fi - -#█▓▒░ git prompt -GIT_PROMPT() { - test=$(git rev-parse --is-inside-work-tree 2> /dev/null) - if [ ! "$test" ] - then - case "$PROMPT_STYLE" in - ascii) - echo "$reset_color%F{cyan}▒░" - ;; - arrows) - echo "$reset_color%F{cyan}" - ;; - esac - return - fi - ref=$(git name-rev --name-only HEAD | sed 's!remotes/!!' 2> /dev/null) - dirty="" && [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]] && dirty=$ICO_DIRTY - stat=$(git status | sed -n 2p) - case "$stat" in - *ahead*) - stat=$ICO_AHEAD - ;; - *behind*) - stat=$ICO_BEHIND - ;; - *diverged*) - stat=$ICO_DIVERGED - ;; - *) - stat="" - ;; - esac - case "$PROMPT_STYLE" in - ninja) - echo "${COLOR_NORMAL}${ref}${dirty}${stat}" - ;; - ascii) - echo "%{$bg[magenta]%}%F{cyan}▓▒░ %F{black}${ref}${dirty}${stat} $reset_color%F{magenta}▒░" - ;; - arrows) - echo "%{$bg[magenta]%}%F{cyan} %F{black}${ref}${dirty}${stat} $reset_color%F{magenta}" - ;; - *) - echo "${USER_LEVEL}─[${COLOR_NORMAL}"${ref}${dirty}${stat}"${USER_LEVEL}]" - ;; - esac -} -case "$PROMPT_STYLE" in -#█▓▒░ ascii -ascii) -PROMPT='%{$bg[cyan]%} %F{black}%~ $(GIT_PROMPT)$reset_color -%f' -;; -#█▓▒░ arrows -arrows) -PROMPT='%{$bg[cyan]%}%F{black} %~ $(GIT_PROMPT)$reset_color -%f' -;; -#█▓▒░ ninja -ninja) -PROMPT='%F{white} - ▟▙ ${USER_LEVEL}%~ %F{white}$(GIT_PROMPT) %F{white} -▟▒${USER_LEVEL}░░░░░░░%F{white}▜▙▜████████████████████████████████▛ -▜▒${USER_LEVEL}░░░░░░░%F{white}▟▛▟▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▛ - ▜▛ - %f' -;; -#█▓▒░ dual line -dual) -PROMPT='${USER_LEVEL}┌[${COLOR_NORMAL}%~${USER_LEVEL}]$(GIT_PROMPT) -${USER_LEVEL}└─ - %f' -;; -#█▓▒░ classic -*) -PROMPT='${USER_LEVEL}[${COLOR_NORMAL}%~${USER_LEVEL}]$(GIT_PROMPT)── - %f' -;; -esac