summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Labedan <plabedan@gmail.com>2017-02-01 21:54:25 +0100
committerPaul Labedan <plabedan@gmail.com>2017-02-01 21:54:40 +0100
commitd281bed931e1b0cc23a73564b21926420d7dd64d (patch)
tree275bb93986e74e3ddf2c7f00ccab1668799aa9b6
parentupdate sets (diff)
downloadplab-d281bed931e1b0cc23a73564b21926420d7dd64d.tar.gz
plab-d281bed931e1b0cc23a73564b21926420d7dd64d.tar.bz2
plab-d281bed931e1b0cc23a73564b21926420d7dd64d.zip
zsh-pol-config: use vcs_info module
-rw-r--r--app-shells/zsh-pol-config/Manifest4
-rw-r--r--app-shells/zsh-pol-config/files/zshprompt77
-rw-r--r--app-shells/zsh-pol-config/zsh-pol-config-1.6.ebuild (renamed from app-shells/zsh-pol-config/zsh-pol-config-1.5-r3.ebuild)0
3 files changed, 22 insertions, 59 deletions
diff --git a/app-shells/zsh-pol-config/Manifest b/app-shells/zsh-pol-config/Manifest
index c1410be..b970a08 100644
--- a/app-shells/zsh-pol-config/Manifest
+++ b/app-shells/zsh-pol-config/Manifest
@@ -3,6 +3,6 @@ AUX zlogin 533 SHA256 97ff06829c77ec7f2976a320878af505a0e0c6e13364b425491dc327bc
AUX zlogout 284 SHA256 2155f6a853c9966bfafff96ff29b6f625f5783af2379a640ec40bf7f5eddea0b SHA512 0558fc433d12ff470d029ad013afb02b15af84e073caffe1e2f514ae388a845536017fef6a814986f26daee3abdd9105b6096d495a0a8344615a0d4d71bfd298 WHIRLPOOL 07f481b81f3b3b6bf99d34467ee6384848e3f460f7af438acfc6cf2d8f577a122295ced02e126db55f5e667230ddadb8a9cd605cf2b0e394fd75fe09a809de94
AUX zprofile 1345 SHA256 45c22f5811a8dc4539d363898b53dbcbaef183bf6e8f6ead1a3a837cbedfc7c4 SHA512 ea7d75d4b5137ee592641c592ad0a85baf3aa2b14be6f0fb85cdb9c02d222f0cab08445c825ce7774bf7104ae712f5a7f42dbef27135469c0fa48d1b1c30906a WHIRLPOOL 360d5463a704b0cfe0216a04e94dc5b8924601dd2cd820299444975ec2fbf23f2ee33786d93aa498b015324ac3341bdf78f186fbfc1003b4ace9d80b9cbc86d3
AUX zshenv 1103 SHA256 4c5ec737aff9d54b0bd88b12392f0b3cb3f05dec0671b33938d1f49ce94285d1 SHA512 096fffff3eae492e9786a1f58be8e9b7615f219771ecedf3557f4e2f00f8376d84657f9bd101a6c143cc7db207053ef552d9a96d3a32a34a24a1b290dc07bc21 WHIRLPOOL c221e9a2407b31253aa7b2957426af289e21e5808fcf3dae0ae32739007186a894b2e9ae6dd96fac04e2099c62e7f3d304ea427db974ba13e56cadacb86f9ede
-AUX zshprompt 1528 SHA256 209626f498465f75e403c527b000944f8f0c0582795a31fa04ec75e634703566 SHA512 82e9cb341d4b72e4fb372d0ecffac089920eeb0e3faa14cf2fef9855143b5560c83669c0ce44258d3ed72a8276e7ec1cdbe26daa86c2dc9fc4afc8bf181710fd WHIRLPOOL 2b64cc597f51302f639eed0efd887594f30e7f354b3f6ff74aa51526c386f60039a826255f6ff40d4cce3325b94dd65e20f9cee9dad57af40ff035d953aed6df
+AUX zshprompt 595 SHA256 14030952403e245f3c74ed1bef5c84e9c3122319188295fa5cc8405e27ed6497 SHA512 24b00bdd3fc8f971de3d3fcf7657109f34b0faac7f993e9a2738978b04e6b545fca3aa867210d0894246abd1a91d855be9d44bdb7289cf781a15b12badb966a3 WHIRLPOOL 33d89cd099004705e0c24da9c1971cbd26dbd39fd099199a308ec90a823442d9aa254aab72e99457be5cf86ecfb893e36844d3236a5ab36d32cf7738118472bb
AUX zshrc 4190 SHA256 f40edaee137fd8422632c9431e852515b60f5ad711195ae61d1a22953b1c404c SHA512 0a1423436c647e247a7a4894f990b326c4a4532b9680dcc2127c06a380f2d78fe433ed50960b82fbb9c0b299434e7e6563e4fa8c0ae49a088044ee94d5a15caa WHIRLPOOL b33f8fca7a21fcaf9327f66755a1835cedcbb95b347e3dcc4c93a028b02f0e23ccbb661a197de3afe6f1c51994b9e9bde0c2b6af8f606a72e30e4d26244bf50d
-EBUILD zsh-pol-config-1.5-r3.ebuild 346 SHA256 05f5488f7f6a3225fe7b11bf3805e286e9a45543a359fbc7c98b7cc9bf92c745 SHA512 632ba787007d2c30390bb5642757018cf82a622c2c7465eaea6cf26350395ccf539ccb971535da580a75de7a37b56ef30f9210a8252c6e415d556fd7693a3482 WHIRLPOOL 1886e99fcf65ae21f3e48e45675f050d74aef7e96b47eb56d3a3bd168c9aeb33a120fd07fc1c1541a3347f3e3d95dc31d5c43f7b14b5b83d6a4cfc266807f632
+EBUILD zsh-pol-config-1.6.ebuild 346 SHA256 05f5488f7f6a3225fe7b11bf3805e286e9a45543a359fbc7c98b7cc9bf92c745 SHA512 632ba787007d2c30390bb5642757018cf82a622c2c7465eaea6cf26350395ccf539ccb971535da580a75de7a37b56ef30f9210a8252c6e415d556fd7693a3482 WHIRLPOOL 1886e99fcf65ae21f3e48e45675f050d74aef7e96b47eb56d3a3bd168c9aeb33a120fd07fc1c1541a3347f3e3d95dc31d5c43f7b14b5b83d6a4cfc266807f632
diff --git a/app-shells/zsh-pol-config/files/zshprompt b/app-shells/zsh-pol-config/files/zshprompt
index 03545e7..cd4ad4c 100644
--- a/app-shells/zsh-pol-config/files/zshprompt
+++ b/app-shells/zsh-pol-config/files/zshprompt
@@ -1,64 +1,27 @@
setopt prompt_subst
-autoload colors
-colors
autoload -Uz vcs_info
+autoload -U colors && colors
-for COLOR in RED GREEN BLUE YELLOW WHITE BLACK CYAN; do
- eval PR_$COLOR='%{$fg[${(L)COLOR}]%}'
- eval PR_BRIGHT_$COLOR='%{$fg_bold[${(L)COLOR}]%}'
-done
-PR_RESET="%{%b%s%u$reset_color%}"
+zstyle ':vcs_info:*' check-for-changes true
+zstyle ':vcs_info:*' stagedstr '%F{green}'
+zstyle ':vcs_info:*' unstagedstr '%B%F{red}'
-typeset -ga preexec_functions
-typeset -ga precmd_functions
-typeset -ga chpwd_functions
+zstyle ':vcs_info:*' actionformats ' %F{yellow}%u%c(%b|%a)'
+zstyle ':vcs_info:*' formats ' %F{yellow}%u%c(%b)'
-precmd_functions+='update_prompt'
-preexec_functions+='on_preexec_git_update'
-chpwd_functions+='update_prompt'
-
-function on_preexec_git_update {
- case "$1" in
- git*)
- update_prompt
- ;;
- esac
-}
-
-function make_prompt {
- local c_time=$PR_BRIGHT_CYAN
- local c_user=$1
- local c_host=$2
- local c_path=$PR_GREEN
- local c_git=$PR_YELLOW
- local c_virtualenv=$PR_BRIGHT_BLACK
- local c_sep=$PR_BRIGHT_YELLOW
- local c_r=$PR_RESET
-
- local time="${c_time}%T${c_r}"
- local user="${c_user}%n${c_r}"
- local at="${c_sep}@${c_r}"
- local host="${c_host}%m${c_r}"
- local cwd="${c_path}%B%~%b${c_r}"
- local git="${c_git}$GIT_BRANCH${c_r}"
- local invite="${c_sep}%#${c_r}"
-
- if [ -z ${VIRTUAL_ENV+x} ]; then
- local virtualenv=""
- else
- local virtualenv=" ${c_virtualenv}[$(basename $VIRTUAL_ENV)]${c_r}"
- fi
-
- PROMPT="${time} ${user}${at}${host} ${cwd}${virtualenv}${git}${invite} "
-}
-
-function update_prompt {
- GIT_BRANCH=`git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'`
- if [ "`id -u`" -eq 0 ]; then
- make_prompt $PR_BRIGHT_BLUE $PR_BRIGHT_WHITE
- else
- make_prompt $PR_BRIGHT_RED $PR_BRIGHT_WHITE
- fi
+precmd () {
+ vcs_info
}
-update_prompt
+# time
+PROMPT='%B%F{cyan}%T%b '
+# user
+PROMPT+='%B%(!.%F{blue}.%F{red})%n%b'
+# hostname
+PROMPT+='%B%F{yellow}@%B%F{white}%m%b '
+# cwd
+PROMPT+='%B%F{green}%~%b'
+# vcs info
+PROMPT+='${vcs_info_msg_0_}%b'
+# invite
+PROMPT+='%B%F{yellow}%#%f%b ' \ No newline at end of file
diff --git a/app-shells/zsh-pol-config/zsh-pol-config-1.5-r3.ebuild b/app-shells/zsh-pol-config/zsh-pol-config-1.6.ebuild
index 9b08034..9b08034 100644
--- a/app-shells/zsh-pol-config/zsh-pol-config-1.5-r3.ebuild
+++ b/app-shells/zsh-pol-config/zsh-pol-config-1.6.ebuild