diff options
| author | Akshay Nair <phenax5@gmail.com> | 2020-12-23 23:40:35 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2020-12-23 23:40:35 +0530 |
| commit | 66adff9257c0bdcf5fea357cf4afd9c5804ac9d9 (patch) | |
| tree | 92b9941ed1b211594446c69e1c1a4d57240f1a0e /external/zsh/theme.zsh | |
| parent | c69a505caac996f78b7b010dcc563672cb5a6019 (diff) | |
| download | nixos-config-66adff9257c0bdcf5fea357cf4afd9c5804ac9d9.tar.gz nixos-config-66adff9257c0bdcf5fea357cf4afd9c5804ac9d9.zip | |
Moves zsh config to config and symlinked
Diffstat (limited to 'external/zsh/theme.zsh')
| -rw-r--r-- | external/zsh/theme.zsh | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/external/zsh/theme.zsh b/external/zsh/theme.zsh deleted file mode 100644 index 9fc4fac..0000000 --- a/external/zsh/theme.zsh +++ /dev/null @@ -1,55 +0,0 @@ -setopt prompt_subst - -# Theme -COL_ACCENT=13; - -COL_DIR=$COL_ACCENT; - -COL_STATUS_ERROR=red; -COL_STATUS_BG=cyan; - -COL_GIT_DIRTY=yellow; -COL_GIT_NORMAL=green; - - -segment() { echo -n "%K{$2}%F{$3} $1 %f%k"; } -git_changes() { git status --porcelain 2> /dev/null | wc -l; } - -# Prompt dir -p_dir() { - segment "%2~" $COL_DIR white; -} - -# Prompt terminal status -p_status() { - [[ ! -z "$WITH_NIX_PREFIX" ]] && echo -n "$(segment "[NIX:$WITH_NIX_PREFIX] " black $COL_STATUS_ERROR)"; - echo -n "%(?..$(segment 'x' black $COL_STATUS_ERROR))" - echo -n "%(1j.$(segment '(jobs: %j)' black $COL_STATUS_BG).)" -} - -p_git() { - local ref dirty mode repo_path color; - - if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then - repo_path=$(git rev-parse --git-dir 2>/dev/null); - ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git rev-parse --short HEAD 2> /dev/null)"; - - changes=$(git_changes); - color=$([[ ! $changes = "0" ]] && echo $COL_GIT_DIRTY || echo $COL_GIT_NORMAL); - dirty=$([[ ! $changes = "0" ]] && echo " ($changes)"); - - segment "${ref/refs\/heads\//}$dirty" $color black; - fi -} - -prompt() { - RETVAL=$?; - p_status; - p_dir; - echo -n '$(p_git)'; - segment "$" black white; -} - -export PROMPT="$(prompt) "; -#export RPROMPT='wow' - |
