summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--01_Internal.zsh89
-rw-r--r--10_Environment.zsh1
-rw-r--r--11_Colors.zsh3
-rw-r--r--12_Prompts.zsh15
-rw-r--r--14_Nvm.zsh22
-rw-r--r--user:hugues/Aliases.zsh6
-rw-r--r--user:hugues/Environment.zsh6
-rw-r--r--zshrc1
9 files changed, 110 insertions, 34 deletions
diff --git a/.gitignore b/.gitignore
index 193e618..0fae6c6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
.history.*
.zcompdump
.zcompdump.*
+*.zsh.zwc
diff --git a/01_Internal.zsh b/01_Internal.zsh
index 42d4af4..18d979f 100644
--- a/01_Internal.zsh
+++ b/01_Internal.zsh
@@ -172,6 +172,55 @@ __get_git_fullstatus ()
}
+git_rebase_steps() {
+ GIT_DIR=$(git rev-parse --git-dir 2>&-)
+ if [ -d $GIT_DIR/rebase-merge ]
+ then
+ REBASE_DIR=$GIT_DIR/rebase-merge
+ else
+ REBASE_DIR=$GIT_DIR/rebase-apply
+ fi
+
+ if [ "$REBASE_DIR" = "$GIT_DIR/rebase-merge" ]
+ then
+ if [ -e ${REBASE_DIR}/done ]
+ then
+ current=$(< $REBASE_DIR/done wc -l)
+ else
+ current=0
+ fi
+ last=$(( $current + $(< $REBASE_DIR/git-rebase-todo grep -v "^#\|^[[:blank:]]*$" | wc -l) ))
+ else
+ current=$(cat $REBASE_DIR/next)
+ last=$(cat $REBASE_DIR/last)
+ fi
+
+ echo $current $last
+}
+
+git_rebase_amend() {
+ GIT_DIR=$(git rev-parse --git-dir 2>&-)
+ if [ -d $GIT_DIR/rebase-merge ]
+ then
+ REBASE_DIR=$GIT_DIR/rebase-merge
+ else
+ REBASE_DIR=$GIT_DIR/rebase-apply
+ fi
+ # amended commit
+ if [ -e $REBASE_DIR/stopped-sha ]
+ then
+ amend=$(cat $REBASE_DIR/stopped-sha)
+ elif [ -e $REBASE_DIR/amend ]
+ then
+ amend=$(cat $REBASE_DIR/amend)
+ elif [ -e $REBASE_DIR/original-commit ]
+ then
+ amend=$(cat $REBASE_DIR/original-commit)
+ fi
+
+ echo $amend
+}
+
__get_git_branch ()
{
local my_git_branch checkouted_branch commit_ish
@@ -200,7 +249,7 @@ __get_git_branch ()
commit_ish=$(git rev-parse --verify HEAD 2>/dev/null)
# Get current working GIT branch
- my_git_branch="$(git symbolic-ref --short -q HEAD)"
+ my_git_branch="$(git symbolic-ref --short -q HEAD | sed 's/^refs\///;s/^heads\///')"
#my_git_branch="$(git name-rev --name-only HEAD)"
# for future use
checkouted_branch=$my_git_branch
@@ -281,21 +330,18 @@ __get_git_branch ()
local rebase onto amend current last
local REBASE_DIR
- if [ -d $GIT_DIR/rebase-merge ]
- then
- REBASE_DIR=$GIT_DIR/rebase-merge
- else
- REBASE_DIR=$GIT_DIR/rebase-apply
- fi
+ if [ -d $GIT_DIR/rebase-merge ]
+ then
+ REBASE_DIR=$GIT_DIR/rebase-merge
+ else
+ REBASE_DIR=$GIT_DIR/rebase-apply
+ fi
- if [ "$REBASE_DIR" = "$GIT_DIR/rebase-merge" ]
- then
- current=$(< $REBASE_DIR/done wc -l)
- last=$(( $current + $(< $REBASE_DIR/git-rebase-todo grep -v "^#\|^[[:blank:]]*$" | wc -l) ))
- else
- current=$(cat $REBASE_DIR/next)
- last=$(cat $REBASE_DIR/last)
- fi
+ steps=$(git_rebase_steps)
+ current=${steps%% *}
+ last=${steps##* }
+
+ amend=$(git_rebase_amend)
rebase="["$C_$_prompt_colors[bold_generic]$_C
#while [ $current -gt 0 ] ; do rebase+=$T_"a"$_T ; current=$(( $current - 1 )) ; done
@@ -307,18 +353,6 @@ __get_git_branch ()
# base
onto=$(git name-rev --name-only --always --no-undefined $(cat $REBASE_DIR/onto) 2>&- | __cleanup_git_branch_name)
- # amended commit
- if [ -e $REBASE_DIR/stopped-sha ]
- then
- amend=$(cat $REBASE_DIR/stopped-sha)
- elif [ -e $REBASE_DIR/amend ]
- then
- amend=$(cat $REBASE_DIR/amend)
- elif [ -e $REBASE_DIR/original-commit ]
- then
- amend=$(cat $REBASE_DIR/original-commit)
- fi
- #
if [ "$amend" != "$commit_ish" ]
then
#amend=$(git name-rev --name-only --always --no-undefined "$amend" 2>/dev/null | __cleanup_git_branch_name)
@@ -361,6 +395,7 @@ __get_git_tracking_status() {
local git_tracking_status=""
my_git_branch="$(git symbolic-ref --short -q HEAD)"
+ #my_git_branch="$(git name-rev --name-only HEAD)"
if [ "$my_git_branch" ]
then
diff --git a/10_Environment.zsh b/10_Environment.zsh
index 714172f..0701bfe 100644
--- a/10_Environment.zsh
+++ b/10_Environment.zsh
@@ -118,4 +118,3 @@ then
unset DISPLAY
fi
fi
-
diff --git a/11_Colors.zsh b/11_Colors.zsh
index d5ae7ce..420aacf 100644
--- a/11_Colors.zsh
+++ b/11_Colors.zsh
@@ -76,7 +76,8 @@ __set_prompt_colors ()
_agent_colors[remote_empty]="$color[bold];$color[black]"
_agent_colors[has_keys]="$_prompt_colors[bold_generic]"
_agent_colors[has_remote_keys]="$_prompt_colors[bold_generic]"
- _agent_colors[id_dsa]="$color[bold];$color[yellow]"
+ _agent_colors[id_rsa]="$color[bold];$color[yellow]"
+ _agent_colors[id_dsa]="$color[bold];38;5;196"
_gcl_colors[init]="$color[black];$color[bold]"
_gcl_colors[gitdir]="$color[red];$color[bold]"
diff --git a/12_Prompts.zsh b/12_Prompts.zsh
index 6537b07..6e24bca 100644
--- a/12_Prompts.zsh
+++ b/12_Prompts.zsh
@@ -176,6 +176,21 @@ __ssh_gpg_agents ()
}
PS1_TASKBAR+=(__ssh_gpg_agents)
+__get_a_job()
+{
+ RUNNING_JOBS=$(jobs | grep -c ' running ')
+ SUSPENDED_JOBS=$(jobs | grep ' suspended ' -c)
+ SUSPENDED_TTY_JOBS=$(jobs | grep ' suspended (tty' -c)
+ JOBS=$(($RUNNING_JOBS + $SUSPENDED_JOBS + $SUSPENDED_TTY_JOBS))
+ if [ $JOBS -gt 0 ]
+ then
+ [ $RUNNING_JOBS -gt 0 ] && for i in {1..$RUNNING_JOBS} ; do echo -n "$C_$color[yellow];$color[bold]$_C+" ; done
+ [ $SUSPENDED_TTY_JOBS -gt 0 ] && for i in {1..$SUSPENDED_TTY_JOBS} ; do echo -n "$C_$color[magenta]$_C+" ; done
+ [ $SUSPENDED_JOBS -gt 0 ] && for i in {1..$SUSPENDED_JOBS} ; do echo -n "$C_$color[blue]$_C+" ; done
+ fi
+}
+PS1_TASKBAR+=(__get_a_job)
+
__display ()
{
__debug -n " Display..."
diff --git a/14_Nvm.zsh b/14_Nvm.zsh
new file mode 100644
index 0000000..5e66336
--- /dev/null
+++ b/14_Nvm.zsh
@@ -0,0 +1,22 @@
+##
+## Part of configuration files for Zsh 4
+## by Hugues Hiegel <hugues@hiegel.fr>
+##
+## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS
+##
+## You are encouraged to use, modify, and redistribute
+## these files with or without this notice.
+##
+
+# NVM stuff
+NVM_ENV=~/.nvm/nvm.sh
+if [ -r ${NVM_ENV} ]
+then
+ source ${NVM_ENV}
+ _nvm_env() {
+ which nvm 2>&- >&- && echo "nvm:$(nvm current)"
+ }
+
+ PS1_TASKBAR+=(_nvm_env)
+fi
+
diff --git a/user:hugues/Aliases.zsh b/user:hugues/Aliases.zsh
index 99304f8..773e2f9 100644
--- a/user:hugues/Aliases.zsh
+++ b/user:hugues/Aliases.zsh
@@ -7,8 +7,8 @@
## You are encouraged to use, modify, and redistribute
## these files with or without this notice.
##
-a -g ¬ISO='LC_ALL=br_FR'
-a -g ¬UTF='LC_ALL=br_FR.UTF-8'
+a -g ¬ISO='LC_ALL=fr_FR'
+a -g ¬UTF='LC_ALL=fr_FR.UTF-8'
a -g ...=../..
a -g ....=../../..
@@ -24,6 +24,8 @@ a -g .............=../../../../../../../../../../../..
a -g ..............=../../../../../../../../../../../../..
a -g ...............=../../../../../../../../../../../../../..
a -g ................=../../../../../../../../../../../../../../..
+
+a -g STDBUF="stdbuf -i0 -oL"
if ( __cmd_exists emacs )
then
diff --git a/user:hugues/Environment.zsh b/user:hugues/Environment.zsh
index 492fdc9..b7561df 100644
--- a/user:hugues/Environment.zsh
+++ b/user:hugues/Environment.zsh
@@ -35,8 +35,8 @@ export LESS="-R -F -X"
export NULLCMD=cat
# Locale en français unicode
-export LC_ALL=${LC_ALL:-br_FR.UTF-8}
-export LC_MESSAGES=${LC_MESSAGES:-br_FR}
+export LC_ALL=${LC_ALL:-fr_FR.UTF-8}
+export LC_MESSAGES=${LC_MESSAGES:-fr_FR}
unset LANG # Unuseful
# Utilisation des commandes git-*
@@ -45,6 +45,8 @@ do
[ -d /usr/$i/git-core ] && export PATH=$PATH:/usr/$i/git-core
done
+[ -d ~/.local/bin ] && PATH=$PATH:~/.local/bin
+
# Couleurs pour grep --color=auto
export GREP_COLOR=$color[yellow]\;$color[bold]
export GREP_COLORS="sl="":cx="$color[cyan]":ms="$color[yellow]";"$color[bold]":mc="$color[red]";"$color[bold]":fn="$color[green]""
diff --git a/zshrc b/zshrc
index 8f57c44..9c2ef1b 100644
--- a/zshrc
+++ b/zshrc
@@ -107,4 +107,3 @@ then
export HOME=~$USER
[ "`pwd`" = ~$SUDO_USER ] && cd
fi
-