From 557a54c0cc2a7e4e15af805ba72edc698cb61fde Mon Sep 17 00:00:00 2001 From: Armin Date: Fri, 13 Mar 2015 19:51:09 +0100 Subject: [PATCH 01/17] add powerline colours for reality --- lib/powerline/reality | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 lib/powerline/reality diff --git a/lib/powerline/reality b/lib/powerline/reality new file mode 100644 index 000000000..a25dbc38f --- /dev/null +++ b/lib/powerline/reality @@ -0,0 +1,6 @@ +colours=(252 126 152 32) +prompt_context_user_fg="${colours[1]}" +prompt_context_user_bg="${colours[2]}" +prompt_context_root_fg="${colours[3]}" +prompt_context_root_bg="${colours[4]}" + From f1cb33fb171b1afe2726f1f628ab09bb0535535f Mon Sep 17 00:00:00 2001 From: Armin Date: Fri, 13 Mar 2015 19:51:27 +0100 Subject: [PATCH 02/17] add powerline colours for nagios host --- lib/powerline/nagios | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 lib/powerline/nagios diff --git a/lib/powerline/nagios b/lib/powerline/nagios new file mode 100644 index 000000000..ee6ff7bb8 --- /dev/null +++ b/lib/powerline/nagios @@ -0,0 +1,6 @@ +colours=(252 29 152 32) +prompt_context_user_fg="${colours[1]}" +prompt_context_user_bg="${colours[2]}" +prompt_context_root_fg="${colours[3]}" +prompt_context_root_bg="${colours[4]}" + From f4f220cedff4299119a3f651dcad60d35b099965 Mon Sep 17 00:00:00 2001 From: Armin Date: Fri, 13 Mar 2015 19:52:59 +0100 Subject: [PATCH 03/17] new zshrc, powerline colours for blade --- lib/powerline/blade | 2 +- themes/powerline-with-hostname.zsh-theme | 20 ++++++++++++++++++-- zshrc | 4 +++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/lib/powerline/blade b/lib/powerline/blade index 880d90fdc..22df5db61 100644 --- a/lib/powerline/blade +++ b/lib/powerline/blade @@ -1,4 +1,4 @@ -colours=(252 160 152 32) +colours=(250 58 152 32) prompt_context_user_fg="${colours[1]}" prompt_context_user_bg="${colours[2]}" prompt_context_root_fg="${colours[3]}" diff --git a/themes/powerline-with-hostname.zsh-theme b/themes/powerline-with-hostname.zsh-theme index 850f0568d..51e228302 100644 --- a/themes/powerline-with-hostname.zsh-theme +++ b/themes/powerline-with-hostname.zsh-theme @@ -1,4 +1,5 @@ -# vim:ft=zsh ts=2 sw=2 sts=2 +# zshrc +# vim: ts=2 sw=2 sts=2 et # # powerline theme - based on agnoster's theme - https://gist.github.com/3712874 # @@ -189,12 +190,27 @@ build_prompt() { ## right prompt build_rprompt() { RETVAL=$? + FOO="$!" local symbols symbols=() drawrightprompt=0 [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙" && drawrightprompt=1 [[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡" && drawrightprompt=1 - [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}✘ $RETVAL" && drawrightprompt=1 + if [[ $ZLE_LINE_ABORTED ]]; then + [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%} ✘ " && drawrightprompt=1 + else + lastchars=8 + last="$(fc -nl -1 | cut -b -${lastchars})..." + + if [[ "${#last}" -gt "$lastchars" ]]; then + last="$(fc -nl -1 | cut -b -${lastchars})..." + else + last="$(fc -nl -1 | cut -b -${lastchars})" + fi + +# [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%} ✘ $RETVAL $(fc -nl -1 | cut -b -8)..." && drawrightprompt=1 + [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%} ✘" && drawrightprompt=1 + fi if [[ "$drawrightprompt" -eq 1 ]]; then prompt_rseperator %k 238 fi diff --git a/zshrc b/zshrc index a28742041..44b0dd9c7 100644 --- a/zshrc +++ b/zshrc @@ -21,7 +21,7 @@ DISABLE_LS_COLORS="false" # bool DISABLE_AUTO_TITLE="false" # bool # Uncomment following line if you want disable red dots displayed while waiting for completion -DISABLE_COMPLETION_WAITING_DOTS="true" # bool +DISABLE_COMPLETION_WAITING_DOTS="false" # bool # plugins to load (array) # Example format: plugins=(rails git textmate ruby lighthouse) @@ -192,4 +192,6 @@ alias less='less -R' alias diff='colordiff' +set modeline + From 248b9c1f0c493c4634bfbef21be5f75d774c39df Mon Sep 17 00:00:00 2001 From: Armin Jenewein Date: Sat, 14 Mar 2015 14:14:58 +0100 Subject: [PATCH 04/17] fixed powerline-with-hostname theme --- themes/powerline-with-hostname.zsh-theme | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/themes/powerline-with-hostname.zsh-theme b/themes/powerline-with-hostname.zsh-theme index 51e228302..41574afc3 100644 --- a/themes/powerline-with-hostname.zsh-theme +++ b/themes/powerline-with-hostname.zsh-theme @@ -1,5 +1,4 @@ -# zshrc -# vim: ts=2 sw=2 sts=2 et +# vim:ft=zsh ts=2 sw=2 sts=2 # # powerline theme - based on agnoster's theme - https://gist.github.com/3712874 # @@ -187,30 +186,15 @@ build_prompt() { prompt_end } -## right prompt +## right prompt (fixed) build_rprompt() { RETVAL=$? - FOO="$!" local symbols symbols=() drawrightprompt=0 [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙" && drawrightprompt=1 [[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡" && drawrightprompt=1 - if [[ $ZLE_LINE_ABORTED ]]; then - [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%} ✘ " && drawrightprompt=1 - else - lastchars=8 - last="$(fc -nl -1 | cut -b -${lastchars})..." - - if [[ "${#last}" -gt "$lastchars" ]]; then - last="$(fc -nl -1 | cut -b -${lastchars})..." - else - last="$(fc -nl -1 | cut -b -${lastchars})" - fi - -# [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%} ✘ $RETVAL $(fc -nl -1 | cut -b -8)..." && drawrightprompt=1 - [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%} ✘" && drawrightprompt=1 - fi + [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}✘ $RETVAL" && drawrightprompt=1 if [[ "$drawrightprompt" -eq 1 ]]; then prompt_rseperator %k 238 fi From 47cd998d5ac0443c655bde1e687a775341383baa Mon Sep 17 00:00:00 2001 From: Armin Date: Sat, 14 Mar 2015 14:18:26 +0100 Subject: [PATCH 05/17] add gate --- lib/powerline/gate | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 lib/powerline/gate diff --git a/lib/powerline/gate b/lib/powerline/gate new file mode 100644 index 000000000..ee6ff7bb8 --- /dev/null +++ b/lib/powerline/gate @@ -0,0 +1,6 @@ +colours=(252 29 152 32) +prompt_context_user_fg="${colours[1]}" +prompt_context_user_bg="${colours[2]}" +prompt_context_root_fg="${colours[3]}" +prompt_context_root_bg="${colours[4]}" + From b35a583c09454f357b819e38d91756070fcc1e7c Mon Sep 17 00:00:00 2001 From: Armin Date: Sat, 14 Mar 2015 17:36:25 +0100 Subject: [PATCH 06/17] added 256 color support for man pages --- zshrc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/zshrc b/zshrc index 9fba7609d..3b6d4b7b8 100644 --- a/zshrc +++ b/zshrc @@ -52,14 +52,21 @@ export PATH=$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin:$PATH # set $EDITOR export EDITOR='vim' -# man pages: color -export LESS_TERMCAP_mb=$'\E[01;31m' -export LESS_TERMCAP_md=$'\E[01;33m' +### colors in man pages :) +### ::: man pages: basic coloring ::: +# export LESS_TERMCAP_mb=$'\E[01;31m' +# export LESS_TERMCAP_md=$'\E[01;33m' export LESS_TERMCAP_me=$'\E[0m' export LESS_TERMCAP_se=$'\E[0m' -export LESS_TERMCAP_so=$'\E[01;44;33m' +# export LESS_TERMCAP_so=$'\E[01;44;33m' export LESS_TERMCAP_ue=$'\E[0m' -export LESS_TERMCAP_us=$'\E[01;32m' +# export LESS_TERMCAP_us=$'\E[01;32m' +### ::: man pages (more beautiful 256 coloring) ::: +export LESS_TERMCAP_mb=$'' +export LESS_TERMCAP_md=$'' +export LESS_TERMCAP_so=$'' +export LESS_TERMCAP_us=$'' + # zsh fix for ssh host completion from ~/.ssh/config [ -f ~/.ssh/config ] && : ${(A)ssh_config_hosts:=${${${${(@M)${(f)"$(<~/.ssh/config)"}:#Host *}#Host }:#*\**}:#*\?*}} From c12cd92396a30f34bbd7e92ac8d1c17194407327 Mon Sep 17 00:00:00 2001 From: Armin Date: Sat, 14 Mar 2015 17:36:46 +0100 Subject: [PATCH 07/17] new colors for blade prompt --- lib/powerline/blade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/powerline/blade b/lib/powerline/blade index 22df5db61..b7c7d6299 100644 --- a/lib/powerline/blade +++ b/lib/powerline/blade @@ -1,4 +1,4 @@ -colours=(250 58 152 32) +colours=(250 236 152 32) prompt_context_user_fg="${colours[1]}" prompt_context_user_bg="${colours[2]}" prompt_context_root_fg="${colours[3]}" From 43e866695e86940dd7f72b104ad0cb47cbed6482 Mon Sep 17 00:00:00 2001 From: Armin Date: Sat, 14 Mar 2015 17:40:05 +0100 Subject: [PATCH 08/17] more beautiful man page colors --- zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zshrc b/zshrc index 3b6d4b7b8..ae71caf45 100644 --- a/zshrc +++ b/zshrc @@ -63,9 +63,9 @@ export LESS_TERMCAP_ue=$'\E[0m' # export LESS_TERMCAP_us=$'\E[01;32m' ### ::: man pages (more beautiful 256 coloring) ::: export LESS_TERMCAP_mb=$'' -export LESS_TERMCAP_md=$'' +export LESS_TERMCAP_md=$'' export LESS_TERMCAP_so=$'' -export LESS_TERMCAP_us=$'' +export LESS_TERMCAP_us=$'' # zsh fix for ssh host completion from ~/.ssh/config From 222226ffb66d86ba25b1856efa2d7b90b3514d22 Mon Sep 17 00:00:00 2001 From: Armin Jenewein Date: Wed, 18 Mar 2015 13:01:52 +0100 Subject: [PATCH 09/17] add color definition for box --- lib/powerline/box | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 lib/powerline/box diff --git a/lib/powerline/box b/lib/powerline/box new file mode 100644 index 000000000..92840a0ed --- /dev/null +++ b/lib/powerline/box @@ -0,0 +1,10 @@ +# use $HOME/.zsh/256-color-test.py to test colors. + +# user colors +prompt_context_user_fg="252" +prompt_context_user_bg="240" + +# root colors +prompt_context_root_fg="152" +prompt_context_root_bg="32" + From dc79ff446655559728b16dbf98a1f90037225863 Mon Sep 17 00:00:00 2001 From: Armin Jenewein Date: Wed, 18 Mar 2015 13:11:11 +0100 Subject: [PATCH 10/17] fix: prompt_context (foreground), changes to box theme --- lib/powerline/box | 8 ++++++-- themes/powerline-with-hostname.zsh-theme | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/powerline/box b/lib/powerline/box index 92840a0ed..9805db10d 100644 --- a/lib/powerline/box +++ b/lib/powerline/box @@ -1,10 +1,14 @@ # use $HOME/.zsh/256-color-test.py to test colors. +echo true + # user colors prompt_context_user_fg="252" prompt_context_user_bg="240" # root colors -prompt_context_root_fg="152" -prompt_context_root_bg="32" +prompt_context_root_fg="172" +prompt_context_root_bg="52" + + diff --git a/themes/powerline-with-hostname.zsh-theme b/themes/powerline-with-hostname.zsh-theme index 41574afc3..fbcce1c66 100644 --- a/themes/powerline-with-hostname.zsh-theme +++ b/themes/powerline-with-hostname.zsh-theme @@ -83,10 +83,10 @@ prompt_context() { local machine="$(hostname -s)" if [[ "$user" == "root" ]]; then # prompt for root - prompt_segment "$prompt_context_root_bg" "$prompt_context_root_fg" "%(!.%{%F{red}%}.)$user@$machine" + prompt_segment "$prompt_context_root_bg" "$prompt_context_root_fg" "%(!.%{%F{${prompt_context_root_fg}}%}.)$user@$machine" else # prompt for normal user - prompt_segment "$prompt_context_user_bg" "$prompt_context_user_fg" "%(!.%{%F{yellow}%}.)$user@$machine" + prompt_segment "$prompt_context_user_bg" "$prompt_context_user_fg" "%(!.%{%F{${prompt_context_user_fg}}%}.)$user@$machine" fi } From b75924c7b47fb081b5c375f0beb9f2e9cc664759 Mon Sep 17 00:00:00 2001 From: Armin Jenewein Date: Wed, 18 Mar 2015 13:12:12 +0100 Subject: [PATCH 11/17] fix --- lib/powerline/box | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/powerline/box b/lib/powerline/box index 9805db10d..341e0dffd 100644 --- a/lib/powerline/box +++ b/lib/powerline/box @@ -1,7 +1,5 @@ # use $HOME/.zsh/256-color-test.py to test colors. -echo true - # user colors prompt_context_user_fg="252" prompt_context_user_bg="240" From 63c769a02b02b393d68954d6384345a2eef93f3c Mon Sep 17 00:00:00 2001 From: vnc Date: Sat, 21 Mar 2015 19:22:17 +0100 Subject: [PATCH 12/17] bugfixes --- zshrc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/zshrc b/zshrc index ae71caf45..00db035d3 100644 --- a/zshrc +++ b/zshrc @@ -4,9 +4,9 @@ ZSH="$HOME/.zsh" # export ZSH_THEME="random" -# export ZSH_THEME="ezzsh" # name of zsh theme +export ZSH_THEME="ezzsh" # name of zsh theme # export ZSH_THEME="powerline" # name of zsh theme -export ZSH_THEME="powerline-with-hostname" # name of zsh theme +# export ZSH_THEME="powerline-with-hostname" # name of zsh theme # Set this to true to use case-sensitive completion CASE_SENSITIVE="false" # bool @@ -151,6 +151,11 @@ if [[ "$OS_TYPE" == "FreeBSD" ]]; then fi fi +if [[ "$OS_TYPE" == "Linux" ]]; then + alias ls='ls --group-directories-first -F --color=auto' +fi + + # enable ls colorization: if [ "$TERM" != "dumb" ]; then if [[ "$dircolors_enable" == 1 ]]; then @@ -197,12 +202,7 @@ alias sudo='nocorrect sudo' # the more brutal attempt: unsetopt correct{,all} -# colored grep / less -alias grep="grep --color='always'" alias less='less -R' alias diff='colordiff' -set modeline - - From 61cab420cd8b352edec13cfc48faeacde97b1811 Mon Sep 17 00:00:00 2001 From: Armin Date: Sun, 22 Mar 2015 11:37:08 -0400 Subject: [PATCH 13/17] add -E for sudo --- zshrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zshrc b/zshrc index 00db035d3..3bc9d44c3 100644 --- a/zshrc +++ b/zshrc @@ -4,9 +4,9 @@ ZSH="$HOME/.zsh" # export ZSH_THEME="random" -export ZSH_THEME="ezzsh" # name of zsh theme +# export ZSH_THEME="ezzsh" # name of zsh theme # export ZSH_THEME="powerline" # name of zsh theme -# export ZSH_THEME="powerline-with-hostname" # name of zsh theme +export ZSH_THEME="powerline-with-hostname" # name of zsh theme # Set this to true to use case-sensitive completion CASE_SENSITIVE="false" # bool @@ -197,7 +197,7 @@ if [ "$TERM" != "dumb" ]; then fi # do not autocorrect sudo commands (fixes "zsh: correct 'vim' to '.vim' [nyae]?") -alias sudo='nocorrect sudo' +alias sudo='nocorrect sudo -E' # the more brutal attempt: unsetopt correct{,all} From dce635a10568f9a59ee608070941222c814debe7 Mon Sep 17 00:00:00 2001 From: Armin Jenewein Date: Tue, 24 Mar 2015 16:41:59 +0100 Subject: [PATCH 14/17] bugfixes --- zshrc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/zshrc b/zshrc index 3bc9d44c3..ae71caf45 100644 --- a/zshrc +++ b/zshrc @@ -151,11 +151,6 @@ if [[ "$OS_TYPE" == "FreeBSD" ]]; then fi fi -if [[ "$OS_TYPE" == "Linux" ]]; then - alias ls='ls --group-directories-first -F --color=auto' -fi - - # enable ls colorization: if [ "$TERM" != "dumb" ]; then if [[ "$dircolors_enable" == 1 ]]; then @@ -197,12 +192,17 @@ if [ "$TERM" != "dumb" ]; then fi # do not autocorrect sudo commands (fixes "zsh: correct 'vim' to '.vim' [nyae]?") -alias sudo='nocorrect sudo -E' +alias sudo='nocorrect sudo' # the more brutal attempt: unsetopt correct{,all} +# colored grep / less +alias grep="grep --color='always'" alias less='less -R' alias diff='colordiff' +set modeline + + From 202ae23fc72bfbd457a7e55a94b8d7af8920a777 Mon Sep 17 00:00:00 2001 From: Armin Date: Wed, 25 Mar 2015 11:07:36 +0100 Subject: [PATCH 15/17] bugfix --- zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zshrc b/zshrc index ae71caf45..31b411bcb 100644 --- a/zshrc +++ b/zshrc @@ -202,7 +202,7 @@ alias grep="grep --color='always'" alias less='less -R' alias diff='colordiff' - -set modeline +alias s='sudo -s -E' + From e9e8e2f93aa4d7a513bd2d52999252dd3b640edf Mon Sep 17 00:00:00 2001 From: Armin Jenewein Date: Thu, 26 Mar 2015 11:22:30 +0100 Subject: [PATCH 16/17] new colors for "box", new aliases / options in zshrc --- zshrc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/zshrc b/zshrc index ae71caf45..d3fbc5998 100644 --- a/zshrc +++ b/zshrc @@ -151,6 +151,11 @@ if [[ "$OS_TYPE" == "FreeBSD" ]]; then fi fi +if [[ "$OS_TYPE" == "Linux" ]]; then + LS_COMMAND=ls + dircolors_enable=1 +fi + # enable ls colorization: if [ "$TERM" != "dumb" ]; then if [[ "$dircolors_enable" == 1 ]]; then @@ -202,7 +207,9 @@ alias grep="grep --color='always'" alias less='less -R' alias diff='colordiff' +# sudo shell with "s" +alias s='sudo -s -E' -set modeline - +# don't require "rehash" after installing a package +setopt nohashdirs From 4efefc519b6ee3eeee2a6cdbf8b55cfec82b47ff Mon Sep 17 00:00:00 2001 From: Armin Date: Mon, 30 Mar 2015 06:09:38 +0200 Subject: [PATCH 17/17] changes, changes... --- lib/powerline/pad | 8 ++++++++ zshrc | 21 ++++++++++++++++----- 2 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 lib/powerline/pad diff --git a/lib/powerline/pad b/lib/powerline/pad new file mode 100644 index 000000000..30c9b4a20 --- /dev/null +++ b/lib/powerline/pad @@ -0,0 +1,8 @@ +colours=(250 60 152 32) + +prompt_context_user_fg="${colours[1]}" +prompt_context_user_bg="${colours[2]}" + +prompt_context_root_fg="${colours[3]}" +prompt_context_root_bg="${colours[4]}" + diff --git a/zshrc b/zshrc index ae71caf45..8b1143356 100644 --- a/zshrc +++ b/zshrc @@ -8,6 +8,10 @@ ZSH="$HOME/.zsh" # export ZSH_THEME="powerline" # name of zsh theme export ZSH_THEME="powerline-with-hostname" # name of zsh theme +if [[ "$TERM" == "linux" ]]; then + export ZSH_THEME=ezzsh +fi + # Set this to true to use case-sensitive completion CASE_SENSITIVE="false" # bool @@ -185,10 +189,16 @@ alias grep='grep --color=auto' # enable ls colorization: if [ "$TERM" != "dumb" ]; then - if [[ "$dircolors_enable" == 1 ]]; then - eval "$(dircolors "$ZSH"/dircolors)" - alias ls="$LS_COMMAND $LS_OPTIONS" - fi + #if [[ "$dircolors_enable" == 1 ]]; then + # eval "$(dircolors "$ZSH"/dircolors)" + # alias ls="$LS_COMMAND $LS_OPTIONS" + #fi + alias ls="$LS_COMMAND $LS_OPTIONS" +fi + +# Fix for KDEs stupid Konsole program +if [[ $KONSOLE_PROFILE_NAME ]]; then + export TERM=xterm-256color fi # do not autocorrect sudo commands (fixes "zsh: correct 'vim' to '.vim' [nyae]?") @@ -203,6 +213,7 @@ alias less='less -R' alias diff='colordiff' -set modeline +alias s="sudo -s -E" +