From 80e50a0a8cc16c1af8eb4bd6041e1ce990a5b588 Mon Sep 17 00:00:00 2001 From: hobbestigrou Date: Fri, 8 Oct 2010 23:21:12 +0200 Subject: [PATCH 01/15] I add two function to have logs with colors --- lib/functions.zsh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/functions.zsh b/lib/functions.zsh index 561586cba..8919c7200 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -38,3 +38,10 @@ function take() { cd $1 } +function logview() { + ccze -A < $1 | less -R +} + +function logtail() { + tail -f $1 | ccze +} From 97c6cf516472ef5138659bddc210db84cc62c8ad Mon Sep 17 00:00:00 2001 From: hobbestigrou Date: Fri, 8 Oct 2010 23:46:18 +0200 Subject: [PATCH 02/15] Add a Perl plugin. --- plugins/perl/perl.ruby.zsh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 plugins/perl/perl.ruby.zsh diff --git a/plugins/perl/perl.ruby.zsh b/plugins/perl/perl.ruby.zsh new file mode 100644 index 000000000..4a9801db2 --- /dev/null +++ b/plugins/perl/perl.ruby.zsh @@ -0,0 +1,7 @@ +alias scpan='sudo cpan' + +# Find perl file +alias pfind='find . -name *.pl | xargs grep -n' + +#Check syntax perl file +alias psc='perl -c' From dbbee35cde86c674d89fb68e7acc9b212f060a82 Mon Sep 17 00:00:00 2001 From: hobbestigrou Date: Sat, 9 Oct 2010 20:11:36 +0200 Subject: [PATCH 03/15] Rename file, typo. --- plugins/perl/{perl.ruby.zsh => perl.plugin.zsh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename plugins/perl/{perl.ruby.zsh => perl.plugin.zsh} (100%) diff --git a/plugins/perl/perl.ruby.zsh b/plugins/perl/perl.plugin.zsh similarity index 100% rename from plugins/perl/perl.ruby.zsh rename to plugins/perl/perl.plugin.zsh From 6e2e576e388e2407dc83a5f1af98c68a6e36f220 Mon Sep 17 00:00:00 2001 From: hobbestigrou Date: Sat, 9 Oct 2010 20:17:00 +0200 Subject: [PATCH 04/15] For have the perldoc in a french. --- plugins/perl/perl.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/perl/perl.plugin.zsh b/plugins/perl/perl.plugin.zsh index 4a9801db2..0584fd6d0 100644 --- a/plugins/perl/perl.plugin.zsh +++ b/plugins/perl/perl.plugin.zsh @@ -5,3 +5,6 @@ alias pfind='find . -name *.pl | xargs grep -n' #Check syntax perl file alias psc='perl -c' + +#French perldoc +alias perldoc-fr="perldoc -L FR" From 97357afb26937fbe86330d7c72ce2ea44aac6885 Mon Sep 17 00:00:00 2001 From: hobbestigrou Date: Mon, 11 Oct 2010 21:19:23 +0200 Subject: [PATCH 05/15] More generic. --- lib/misc.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/misc.zsh b/lib/misc.zsh index 4c1743657..88732e664 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -10,4 +10,4 @@ setopt long_list_jobs ## pager export PAGER=less -export LC_CTYPE=en_US.UTF-8 +export LC_CTYPE=$LANG From b57709b8b94495ea7af104ad01569c50229534a1 Mon Sep 17 00:00:00 2001 From: hobbestigrou Date: Thu, 14 Oct 2010 01:30:45 +0200 Subject: [PATCH 06/15] My theme. --- mahewin.zsh-theme | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 mahewin.zsh-theme diff --git a/mahewin.zsh-theme b/mahewin.zsh-theme new file mode 100644 index 000000000..1a74b92b1 --- /dev/null +++ b/mahewin.zsh-theme @@ -0,0 +1,18 @@ +# Author: Hobbestigrou +# Desc: Based on xiong-chiamiov-plus +# last_update: 14/10/2010 + +if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="white"; fi + +PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %I:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} +%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <$(git_prompt_info)>%{\e[0m%}%b ' +PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' + +# git theming +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}[%{$fg_no_bold[yellow]%}%B" +ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[blue]%}]%{$reset_color%} " +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_no_bold[green]%}●" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_no_bold[red]%}●" + +#ls colors +LS_COLORS='rs=0:di=01;37:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:'; From 668d01aa5f26e60bc8eed89581ccebc3b828043f Mon Sep 17 00:00:00 2001 From: hobbestigrou Date: Thu, 14 Oct 2010 01:34:58 +0200 Subject: [PATCH 07/15] Not good directory. --- mahewin.zsh-theme => themes/mahewin.zsh-theme | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename mahewin.zsh-theme => themes/mahewin.zsh-theme (100%) diff --git a/mahewin.zsh-theme b/themes/mahewin.zsh-theme similarity index 100% rename from mahewin.zsh-theme rename to themes/mahewin.zsh-theme From 4a77b0d4eccd2a2278c1a4e5a373d590b6670543 Mon Sep 17 00:00:00 2001 From: hobbestigrou Date: Sun, 31 Oct 2010 23:05:24 +0100 Subject: [PATCH 08/15] Trace query SQL. --- plugins/perl/perl.plugin.zsh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/perl/perl.plugin.zsh b/plugins/perl/perl.plugin.zsh index 0584fd6d0..6e07adfd7 100644 --- a/plugins/perl/perl.plugin.zsh +++ b/plugins/perl/perl.plugin.zsh @@ -8,3 +8,7 @@ alias psc='perl -c' #French perldoc alias perldoc-fr="perldoc -L FR" + +#Trace query SQL +export DBIC_TRACE=1 +export DBI_TRACE=1 From 6e1a6371475850101e07126fe04c645f1a15868a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Natal=20Ng=C3=A9tal?= Date: Tue, 18 Jan 2011 16:04:09 +0100 Subject: [PATCH 09/15] [Plugin] Git: Add few alias. --- plugins/git/git.plugin.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 655eaf728..ec3badc2e 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -1,6 +1,7 @@ # Aliases alias g='git' alias gst='git status' +alias gsts='git status --short' alias gl='git pull' alias gup='git fetch && git rebase' alias gp='git push' @@ -12,6 +13,7 @@ alias gb='git branch' alias gba='git branch -a' alias gcount='git shortlog -sn' alias gcp='git cherry-pick' +alias gcpe='git cherry-pick --edit ' # Git and svn mix @@ -29,4 +31,4 @@ function current_branch() { # these aliases take advangate of the previous function alias ggpull='git pull origin $(current_branch)' alias ggpush='git push origin $(current_branch)' -alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)' \ No newline at end of file +alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)' From e2971559e5ca811fdba32456102d1c320a0cfec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Natal=20Ng=C3=A9tal?= Date: Wed, 19 Jan 2011 12:19:55 +0100 Subject: [PATCH 10/15] [Themes] Mahewin: Export ls_colors define. --- themes/mahewin.zsh-theme | 1 + 1 file changed, 1 insertion(+) diff --git a/themes/mahewin.zsh-theme b/themes/mahewin.zsh-theme index 1a74b92b1..16c5995ab 100644 --- a/themes/mahewin.zsh-theme +++ b/themes/mahewin.zsh-theme @@ -16,3 +16,4 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_no_bold[red]%}●" #ls colors LS_COLORS='rs=0:di=01;37:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:'; +export LS_COLORS From ee75505bbcebcdbfe2446ebdbf913eab60e68215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Natal=20Ng=C3=A9tal?= Date: Wed, 19 Jan 2011 12:36:58 +0100 Subject: [PATCH 11/15] [Core] Functions: Duplicate same function in lib/directories.zsh mcd. --- lib/functions.zsh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/functions.zsh b/lib/functions.zsh index 8919c7200..a7f7316e4 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -33,11 +33,6 @@ function upgrade_oh_my_zsh() { /bin/sh $ZSH/tools/upgrade.sh } -function take() { - mkdir -p $1 - cd $1 -} - function logview() { ccze -A < $1 | less -R } From 2cefde5fcfeebc6fff2bdd2845236cec94c95a27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Natal=20Ng=C3=A9tal?= Date: Tue, 25 Jan 2011 14:08:20 +0100 Subject: [PATCH 12/15] [Plugin] Git: Alias for git-svn, rebase and dcommit, and if the repos is not clean, use git stash. --- plugins/git/git.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index ec3badc2e..c5864271d 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -18,6 +18,8 @@ alias gcpe='git cherry-pick --edit ' # Git and svn mix alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' +alias gsup= !DIRTY=$(git status --porcelain -uno) && git stash save svn-up-auto && git svn rebase && test -n \"$DIRTY\" && git stash pop +alias gsc=!DIRTY=$(git status --porcelain -uno) && git stash save svn-up-auto && git svn dcommit && test -n \"$DIRTY\" && git stash pop # # Will return the current branch name From bdee6dda0b068f263ad130a4601eb824dc2f496a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Natal=20Ng=C3=A9tal?= Date: Fri, 15 Apr 2011 15:12:41 +0200 Subject: [PATCH 13/15] Replace tabs with space for more coherence. --- plugins/perl/perl.plugin.zsh | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/plugins/perl/perl.plugin.zsh b/plugins/perl/perl.plugin.zsh index 25f537568..1d4a533ab 100644 --- a/plugins/perl/perl.plugin.zsh +++ b/plugins/perl/perl.plugin.zsh @@ -44,22 +44,22 @@ alias latest-perl='curl -s http://www.perl.org/get.html | perl -wlne '\''if (/pe # newpl - creates a basic Perl script file and opens it with $EDITOR newpl () { - # set $EDITOR to 'vim' if it is undefined - [[ -z $EDITOR ]] && EDITOR=vim + # set $EDITOR to 'vim' if it is undefined + [[ -z $EDITOR ]] && EDITOR=vim - # if the file exists, just open it - [[ -e $1 ]] && print "$1 exists; not modifying.\n" && $EDITOR $1 + # if the file exists, just open it + [[ -e $1 ]] && print "$1 exists; not modifying.\n" && $EDITOR $1 - # if it doesn't, make it, and open it - [[ ! -e $1 ]] && print '#!/usr/bin/perl'"\n"'use strict;'"\n"'use warnings;'\ - "\n\n" > $1 && $EDITOR $1 + # if it doesn't, make it, and open it + [[ ! -e $1 ]] && print '#!/usr/bin/perl'"\n"'use strict;'"\n"'use warnings;'\ + "\n\n" > $1 && $EDITOR $1 } # pgs - Perl Global Substitution -# find pattern = 1st arg -# replace pattern = 2nd arg -# filename = 3rd arg +# find pattern = 1st arg +# replace pattern = 2nd arg +# filename = 3rd arg pgs() { # [find] [replace] [filename] perl -i.orig -pe 's/'"$1"'/'"$2"'/g' "$3" } @@ -74,5 +74,3 @@ prep() { # [pattern] [filename unless STDOUT] say() { print "$1\n" } - ->>>>>>> upstream/master From 9369d19c02bc42fe05e8cde4ab3970f8cf34b564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Natal=20Ng=C3=A9tal?= Date: Fri, 15 Apr 2011 15:14:54 +0200 Subject: [PATCH 14/15] [Plugin] Git: Fix typo, bug with vim. --- plugins/git/git.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 54691c50e..1de77a02b 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -9,7 +9,7 @@ alias gup='git fetch && git rebase' compdef _git gup=git-fetch alias gp='git push' compdef _git gp=git-push -gdv() { git-diff -w "$@" | view - } +gdv() { git diff -w "$@" | view - } compdef _git gdv=git-diff alias gc='git commit -v' compdef _git gc=git-commit From 6cd297c91fde494e284b759cb29ceb4df997bae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Natal=20Ng=C3=A9tal?= Date: Fri, 15 Apr 2011 18:01:24 +0200 Subject: [PATCH 15/15] [Plugin] Git: Implemente a git info. --- plugins/git/git.plugin.zsh | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 1de77a02b..015bea18c 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -41,6 +41,47 @@ function current_branch() { echo ${ref#refs/heads/} } +function git-info() { + # author: Duane Johnson + # email: duane.johnson@gmail.com + # date: 2008 Jun 12 + # license: MIT + # + # Based on discussion at http://kerneltrap.org/mailarchive/git/2007/11/12/406496 + + pushd . >/dev/null + + # Find base of git directory + while [ ! -d .git ] && [ ! `pwd` = "/" ]; do cd ..; done + + # Show various information about this git directory + if [ -d .git ]; then + echo "== Remote URL: `git remote -v`" + + echo "== Remote Branches: " + git branch -r + echo + + echo "== Local Branches:" + git branch + echo + + echo "== Configuration (.git/config)" + cat .git/config + echo + + echo "== Most Recent Commit" + git log --max-count=1 + echo + + echo "Type 'git log' for more commits, or 'git show' for full commit details." + else + echo "Not a git repository." + fi + + popd >/dev/null +} + # these aliases take advantage of the previous function alias ggpull='git pull origin $(current_branch)' compdef ggpull=git