From e9b8eaeb8570eaf21edd24f66db03224f65cd788 Mon Sep 17 00:00:00 2001 From: hugues Date: Sat, 10 Jun 2006 17:42:08 +0000 Subject: Zsh power !! git-svn-id: svn+ssh://hugues@maison/opt/svn/private/hugues@242 a0e5b806-a6f9-0310-978d-cbce73f8a913 --- ".zsh/01_Exports.V\303\251lizy" | 9 +++ 00_Exports.prunelle | 20 ----- 00_Exports.zsh | 17 ---- 00_Preambule.zsh | 10 +++ 01_Aliases.paranoid | 6 -- 01_Aliases.prunelle | 3 - 01_Aliases.zsh | 43 ---------- 01_Exports.VZY08001 | 1 + 01_Exports.paranoid | 3 + 01_Exports.prunelle | 21 +++++ 01_Exports.zsh | 62 +++++++++++++++ 02_Aliases.paranoid | 7 ++ 02_Aliases.prunelle | 4 + 02_Aliases.zsh | 48 +++++++++++ 02_Options.zsh | 44 +++++++++++ 02_Zsh.zsh | 171 ---------------------------------------- 03_Completion.zsh | 1 + 04_KeyBindings.zsh | 38 +++++++++ 05_Functions.zsh | 21 +++++ 50_Debug.zsh | 57 ++++++++++++++ 99_Debug.zsh | 48 ----------- 99_Start.zsh | 6 ++ 22 files changed, 332 insertions(+), 308 deletions(-) create mode 100644 ".zsh/01_Exports.V\303\251lizy" delete mode 100644 00_Exports.prunelle delete mode 100644 00_Exports.zsh create mode 100644 00_Preambule.zsh delete mode 100644 01_Aliases.paranoid delete mode 100644 01_Aliases.prunelle delete mode 100644 01_Aliases.zsh create mode 120000 01_Exports.VZY08001 create mode 100644 01_Exports.paranoid create mode 100644 01_Exports.prunelle create mode 100644 01_Exports.zsh create mode 100644 02_Aliases.paranoid create mode 100644 02_Aliases.prunelle create mode 100644 02_Aliases.zsh create mode 100644 02_Options.zsh delete mode 100644 02_Zsh.zsh create mode 100644 04_KeyBindings.zsh create mode 100644 05_Functions.zsh create mode 100644 50_Debug.zsh delete mode 100644 99_Debug.zsh create mode 100644 99_Start.zsh diff --git "a/.zsh/01_Exports.V\303\251lizy" "b/.zsh/01_Exports.V\303\251lizy" new file mode 100644 index 0000000..e294216 --- /dev/null +++ "b/.zsh/01_Exports.V\303\251lizy" @@ -0,0 +1,9 @@ +#!/bin/zsh + +PATH+=:~/souche/tools/bin:/usr/local/urd2/bin:/usr/local/urd2/openrg2_6/mips-linux-uclibc/bin/ +MANPATH+=:/usr/local/urd2/man:~/souche/tools/man + +__PREFIX=/filer1/dev_users/hiegel/souche/tools/ + +# Modification de la couleur du prompt par défaut +PS1_USER_SSH=33 diff --git a/00_Exports.prunelle b/00_Exports.prunelle deleted file mode 100644 index 2dff2d2..0000000 --- a/00_Exports.prunelle +++ /dev/null @@ -1,20 +0,0 @@ - -if ( [ "`uname -s`" = "Darwin" ] ) -then - export DISPLAY=:0 - - ## Fink / DarwinPorts - - MANPATH=/usr/share/man - INFOPATH=/usr/share/info - - for i in usr/X11R6 dp sw ; do - export PATH=$PATH:/$i/bin:/$i/sbin - export MANPATH=$MANPATH:/$i/share/man - export INFOPATH=$INFOPATH:/$i/share/info - done -fi - -PS1_USER="1" -PS1_USER_SSH="$PS1_USER" -PS1_ROOT="31;1" diff --git a/00_Exports.zsh b/00_Exports.zsh deleted file mode 100644 index 6ec70c5..0000000 --- a/00_Exports.zsh +++ /dev/null @@ -1,17 +0,0 @@ -export EDITOR="vim" -export HISTFILE=".zsh/.history.zsh" -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/libs -eval $(dircolors ~/.dir_colors 2>&-) -export PATH=$PATH:~/sbin:~/bin -export PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig -#export PRINTER=Gertrude -export PRINTER=Berthe -export TIME_STYLE="+%Y-%b-%d %H:%M" -export TZ="Europe/Paris" -export PATH=$PATH:~/.pr0n -source $ZDOTDIR/.keychain -# Set locales only if they are undefined -export LC_ALL=${LC_ALL:-fr_FR.UTF-8} -export LC_MESSAGES=${LC_MESSAGES:-fr_FR} -export MANPATH=$MANPATH:~/man -unset LANG # Unuseful diff --git a/00_Preambule.zsh b/00_Preambule.zsh new file mode 100644 index 0000000..317dcf0 --- /dev/null +++ b/00_Preambule.zsh @@ -0,0 +1,10 @@ +#!/bin/zsh +## No more core dumps :) +ulimit -c 0 +umask 002 + +## +## sanity +## +[[ -t 0 ]] && /bin/stty erase "^H" intr "^C" susp "^Z" dsusp "^Y" stop "^S" start "^Q" kill "^U" >& /dev/null + diff --git a/01_Aliases.paranoid b/01_Aliases.paranoid deleted file mode 100644 index 1718c15..0000000 --- a/01_Aliases.paranoid +++ /dev/null @@ -1,6 +0,0 @@ - -## Paranoid specifics aliases - -a mailstat='\mailstat -o ~/.procmail/procmail.log | egrep -v "## procmail:"' -a mails='\mailstat -k ~/.procmail/procmail.log | egrep -v "## procmail:" ; cat ~/.procmail/procmail.log >> ~/.procmail/procmail.log.old ; echo -n > ~/.procmail/procmail.log' -a junkmail='mutt -f ~/Mail/junk.gz' diff --git a/01_Aliases.prunelle b/01_Aliases.prunelle deleted file mode 100644 index b2c0bc2..0000000 --- a/01_Aliases.prunelle +++ /dev/null @@ -1,3 +0,0 @@ -a port='sudo port' -a ls='ls -FG' -a aless='open -a /Applications/DarwinPorts/AquaLess.app' diff --git a/01_Aliases.zsh b/01_Aliases.zsh deleted file mode 100644 index 1ec93a0..0000000 --- a/01_Aliases.zsh +++ /dev/null @@ -1,43 +0,0 @@ -alias a='alias' - -a una=unalias - -a e='emacs' -a ne='emacs -nw' - -a close='eject -t' - -a rm='rm -i' -a mv='mv -i' -autoload zmv -a mmv='noglob zmv -W' - -a apt-get='sudo apt-get' - -a rt='find . -type f \( -name "*~" -o -name ".*~" -o -name "#*#" \) -exec rm -vf \{\} \;' - -a eg=egrep - -a hg='< $HISTFILE egrep' -a lg='ls -lap | egrep' - -a s='cd ..' -a so='cd ${OLDPWD}' - -a x=exit - -a ls='ls -F --color=always' -a l='ls -lh' -a ll='ls -l' -a la='ls -la' -a lc='ls -c' -a lm='ls -ma' -a lc1='\ls -c1' - -a definition='dict -h dict.org' -a traduction='dict -h localhost -P-' - -a dosbox='dosbox -c "mount c \"`pwd`\"" -c "mount d /cdrom -t cdrom" -c "c:" ' -a gnus='emacs -f gnus' - -#a make='make -j' diff --git a/01_Exports.VZY08001 b/01_Exports.VZY08001 new file mode 120000 index 0000000..b4ada7f --- /dev/null +++ b/01_Exports.VZY08001 @@ -0,0 +1 @@ +01_Exports.Vélizy \ No newline at end of file diff --git a/01_Exports.paranoid b/01_Exports.paranoid new file mode 100644 index 0000000..fdb0660 --- /dev/null +++ b/01_Exports.paranoid @@ -0,0 +1,3 @@ +#!/bin/zsh +#export PRINTER=Gertrude +export PRINTER=Berthe diff --git a/01_Exports.prunelle b/01_Exports.prunelle new file mode 100644 index 0000000..b6096ff --- /dev/null +++ b/01_Exports.prunelle @@ -0,0 +1,21 @@ +#!/bin/zsh + +if ( [ "`uname -s`" = "Darwin" ] ) +then + export DISPLAY=:0 + + ## Fink / DarwinPorts + + MANPATH=/usr/share/man + INFOPATH=/usr/share/info + + for i in usr/X11R6 dp sw ; do + export PATH=$PATH:/$i/bin:/$i/sbin + export MANPATH=$MANPATH:/$i/share/man + export INFOPATH=$INFOPATH:/$i/share/info + done +fi + +PS1_USER="1" +PS1_USER_SSH="$PS1_USER" +PS1_ROOT="31;1" diff --git a/01_Exports.zsh b/01_Exports.zsh new file mode 100644 index 0000000..5c2c2ac --- /dev/null +++ b/01_Exports.zsh @@ -0,0 +1,62 @@ +#!/bin/zsh + +export BC_ENV_ARGS="-q" +export EDITOR=${EDITOR:-vim} +export HISTFILE=".zsh/.history.zsh" +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/libs +eval $(dircolors ~/.dir_colors 2>&-) +export PATH=$PATH:~/sbin:~/bin +export PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig +export TIME_STYLE="+%Y-%b-%d %H:%M" +export TZ="Europe/Paris" +source $ZDOTDIR/.keychain +# Set locales only if they are undefined +export LC_ALL=${LC_ALL:-fr_FR.UTF-8} +export LC_MESSAGES=${LC_MESSAGES:-fr_FR} +export MANPATH=$MANPATH:~/man +export NULLCMD=cat +unset LANG # Unuseful + +## +## basic setup +## +LOGCHECK=13 +WATCHFMT=$COLOR_BLUECLAIR"%n"$COLOR_END +WATCHFMT=$WATCHFMT" has "$COLOR_YELLOW"%a %l from %M" +WATCH=notme +WORDCHARS="*?-._[]~=&;!#$%^(){}<>" # I suppressed the '/' + +HISTFILE=$ZDOTDIR/.history +HISTSIZE=42000 +SAVEHIST=42000 + +## +## Prompts +## +# For more info on PROMPT expansion, see 'man zshmisc' +## + +PS1_ROOT=${PS1_ROOT:-31} +if ( [ "$SSH_TTY" = "" ] ) +then + PS1_USER=${PS1_USER:-34} +else + PS1_USER=${PS1_USER_SSH:-35} +fi + +PS1="%{[%(!."$PS1_ROOT"."$PS1_USER")m%}%n%{[1;%(!."$PS1_ROOT"."$PS1_USER")m%}@%{[0;%(!."$PS1_ROOT"."$PS1_USER")m%}%m%{%} (%{%}%y%{%}) [%(!.%{["$PS1_ROOT"m%}%d%{%}.%{["$PS1_USER"m%}%(5~:.../:)%4~%{%})]"${LD_PRELOAD:t:s/lib//:r}" %h%{[%(!."$PS1_ROOT";1."$PS1_USER")m%}#%{%} " + +RPS1="%(?;;%{%}%?%{%}) %{[0;%(!."$PS1_ROOT"."$PS1_USER")m%}%D{%a%d%b|%H:%M'%S}%{%}" + +PS2="%{%}%B%_%b%{%}%B>%b%{%} " + +SPROMPT="zsh: %{%}%B«%R»%b%{%} ? Ce ne serait pas plutôt %{%}%B«%r»%b%{%} ? [nyae] " + +## +# PS3="?# " +# +# PS4="+%N:%i> " +## + + +#TIMEFMT="\`%J': %U user %S system %*E total (%P cpu)" diff --git a/02_Aliases.paranoid b/02_Aliases.paranoid new file mode 100644 index 0000000..283316c --- /dev/null +++ b/02_Aliases.paranoid @@ -0,0 +1,7 @@ +#!/bin/zsh + +## Paranoid specifics aliases + +a mailstat='\mailstat -o ~/.procmail/procmail.log | egrep -v "## procmail:"' +a mails='\mailstat -k ~/.procmail/procmail.log | egrep -v "## procmail:" ; cat ~/.procmail/procmail.log >> ~/.procmail/procmail.log.old ; echo -n > ~/.procmail/procmail.log' +a junkmail='mutt -f ~/Mail/junk.gz' diff --git a/02_Aliases.prunelle b/02_Aliases.prunelle new file mode 100644 index 0000000..f809d35 --- /dev/null +++ b/02_Aliases.prunelle @@ -0,0 +1,4 @@ +#!/bin/zsh +a port='sudo port' +a ls='ls -FG' +a aless='open -a /Applications/DarwinPorts/AquaLess.app' diff --git a/02_Aliases.zsh b/02_Aliases.zsh new file mode 100644 index 0000000..d6b3f74 --- /dev/null +++ b/02_Aliases.zsh @@ -0,0 +1,48 @@ +#!/bin/zsh +alias a='alias' + +a una=unalias + +a ...='cd ../..' + +a e='emacs' +a ne='emacs -nw' + +a close='eject -t' + +a rm='rm -i' +a mv='mv -i' +autoload zmv +a mmv='noglob zmv -W' + +a apt-get='sudo apt-get' + +a rt='find . -type f \( -name "*~" -o -name ".*~" -o -name "#*#" \) -exec rm -vf \{\} \;' + +a eg=egrep + +a hg='< $HISTFILE cat -n | grep' +##'hc' stands for something like 'fc' and 'hg'## +a hc='history 0| grep' +a lg='ls -lap | grep' + +a s='cd ..' +a so='cd ${OLDPWD}' + +a x=exit + +a ls='ls -F --color=always' +a l='ls -lh' +a ll='ls -l' +a la='ls -la' +a lc='ls -c' +a lm='ls -ma' +a lc1='\ls -c1' + +a definition='dict -h dict.org' +a traduction='dict -h localhost -P-' + +a dosbox='dosbox -c "mount c \"`pwd`\"" -c "mount d /cdrom -t cdrom" -c "c:" ' +a gnus='emacs -f gnus' + +#a make='make -j' diff --git a/02_Options.zsh b/02_Options.zsh new file mode 100644 index 0000000..e639593 --- /dev/null +++ b/02_Options.zsh @@ -0,0 +1,44 @@ +#!/bin/zsh + +## +## Options +## +## man zshoptions(1) +## +## +setopt Always_Last_Prompt +setopt Always_to_End +setopt Auto_Cd +setopt Auto_Continue +setopt Auto_List +setopt Auto_Menu +setopt Auto_Param_Keys +#setopt Auto_Param_Slash +setopt Auto_PushD +unsetopt Cd_Able_Vars +setopt Complete_Aliases +setopt Complete_in_Word +#setopt Correct +setopt Correct_All +#setopt Equals +#setopt Extended_Glob +unsetopt Extended_History +setopt Hash_Cmds +setopt Hash_Dirs +setopt Hist_Expire_Dups_First +setopt Hist_Ignore_All_Dups +setopt Hist_Ignore_Space +setopt Hist_No_Functions +setopt Hist_No_Store +setopt Hist_Reduce_Blanks +setopt Inc_Append_History +setopt Magic_Equal_Subst +setopt Mail_Warning +setopt Mark_Dirs +unsetopt Menu_Complete +setopt No_Bg_Nice +setopt No_Hup +setopt No_Prompt_Cr +setopt Numeric_Glob_Sort +unsetopt Prompt_Cr +setopt Pushd_Ignore_Dups diff --git a/02_Zsh.zsh b/02_Zsh.zsh deleted file mode 100644 index 54f4561..0000000 --- a/02_Zsh.zsh +++ /dev/null @@ -1,171 +0,0 @@ -## No more core dumps :) -ulimit -c 0 -umask 077 - -export BC_ENV_ARGS="-q" - -##chmod 700 ~/tmp -##find ~ \( -name '#*#' -o -name '.*~' -o -name '*~' \) -exec rm -f {} \; - -## -## exports && aliases -## - -if [ -f ~/.zsh/.exports.zsh ]; then - source ~/.zsh/.exports.zsh -fi - -if [ -f ~/.zsh/.aliases.zsh ]; then - source ~/.zsh/.aliases.zsh -fi - - -## -## sanity -## -[[ -t 0 ]] && /bin/stty erase "^H" intr "^C" susp "^Z" dsusp "^Y" stop "^S" start "^Q" kill "^U" >& /dev/null - - -case $SHLVL in - *2) CLR_SHLVL="%{%}";; - *3) CLR_SHLVL="%{%}";; - *4) CLR_SHLVL="%{%}";; - *5) CLR_SHLVL="%{%}";; - *6) CLR_SHLVL="%{%}";; -esac - - -## -## basic setup -## -LOGCHECK=13 -WATCHFMT=$COLOR_BLUECLAIR"%n"$COLOR_END -WATCHFMT=$WATCHFMT" has "$COLOR_YELLOW"%a %l from %M" -WATCH=notme -NULLCMD="less -f" -WORDCHARS="*?-._[]~=&;!#$%^(){}<>" # I suppressed the '/' -TIMEFMT="\`%J': %U user %S system %*E total (%P cpu)" - -HISTFILE=$ZDOTDIR/.history -HISTSIZE=42000 -SAVEHIST=42000 - -## -## Prompts -## -# For more info on PROMPT expansion, see 'man zshmisc' -## - -PS1_ROOT=${PS1_ROOT:-31} -if ( [ "$SSH_TTY" = "" ] ) -then - PS1_USER=${PS1_USER:-34} -else - PS1_USER=${PS1_USER_SSH:-35} -fi - -PS1="%{[%(!."$PS1_ROOT"."$PS1_USER")m%}%n%{[1;%(!."$PS1_ROOT"."$PS1_USER")m%}@%{[0;%(!."$PS1_ROOT"."$PS1_USER")m%}%m%{%} (%{%}%y%{%}) [%(!.%{["$PS1_ROOT"m%}%d%{%}.%{["$PS1_USER"m%}%(5~:../:)%4~%{%})]"${LD_PRELOAD:t:s/lib//:r}" %h%{[%(!."$PS1_ROOT";1."$PS1_USER")m%}#%{%} " - -RPS1="%(?;;%{%}%?%{%}) %{[0;%(!."$PS1_ROOT"."$PS1_USER")m%}%D{%a%d%b|%H:%M'%S}%{%}" - -PS2="%{%}%B%_%b%{%}%B>%b%{%} " - -SPROMPT="zsh: %{%}%B«%R»%b%{%} ? Ce ne serait pas plutôt %{%}%B«%r»%b%{%} ? [nyae] " - -## -# PS3="?# " -# -# PS4="+%N:%i> " -## - - -## -## Options -## -setopt correct -#setopt correctall -setopt inc_append_history -setopt histignorealldups -setopt histexpiredupsfirst -setopt alwayslastprompt -setopt always_to_end -setopt auto_cd -setopt _auto_list -setopt auto_menu -setopt auto_param_keys -#setopt auto_param_slash -setopt no_bg_nice -setopt complete_aliases -setopt hash_cmds -setopt hash_dirs -setopt no_hup -setopt mail_warning -setopt magic_equal_subst -setopt numericglobsort -setopt mark_dirs -setopt no_prompt_cr -#setopt equals -#setopt extended_glob -unsetopt promptcr - -## -## bindkey -## - -bindkey "\e[3~" delete-char # delete -bindkey "\e[2~" overwrite-mode # insert -bindkey "\e[A" up-line-or-history # up -bindkey "\e[B" down-line-or-history # down -bindkey "\e\e[C" forward-word # ESC right -bindkey "\e\e[D" backward-word # ESC left -bindkey "\e[5~" up-line-or-history # page up # c'est ultime -bindkey "\e[6~" down-line-or-history # page down -bindkey "\e\e[3~" kill-region # ESC del -#aterm -test $TERM = "rxvt" -o $TERM = "xterm" && -{ - bindkey "\e[1~" beginning-of-line # home - bindkey "\e[4~" end-of-line # end-of-line - bindkey "\eOc" forward-word # CTRL right - bindkey "\eOd" backward-word # CTRL left - bindkey "\e[3$" vi-set-buffer # SHIFT del - bindkey "\eOa" history-search-backward # CTRL UP - bindkey "\eOb" history-search-forward # CTRL DOWN -} -# (gnome-terminal) -#test $TERM = "xterm" && -#{ -# bindkey "\eOH" beginning-of-line # home -# bindkey "\eOF" end-of-line # end-of-line -#} -#bindkey "\C-t" gosmacs-transpose-chars # J, ca c'est un truc pour toi -# ne pas oublier de s'en servir : -# vi-match-bracket est sur ^X^B par defaut -# npo : quote-region est sur ESC-" par defaut -# npo : which-command est sur ESC-? par defaut - - -## -## functions -## -##[[ -t 1 ]] && -chpwd() -{ - case $TERM in - sun-cmd) print -Pn "\e]l%n@%m %~\e\\" ;; - *xterm*|rxvt|(k|E|dt)term|gnome-terminal) print -Pn "\e]0;%n@%m (%l) %~\a" ;; - esac -# print -P "%(/,%78>...>%/,%//)%b" -} - -precmd () -{ -# print -nP "%(?,,%{%}Foirage n°%{%}%?\n)%{%}" -} - -## -## misc commands -## -chpwd -#(/bin/rm -f ~/.saves-*) 2>/dev/null - diff --git a/03_Completion.zsh b/03_Completion.zsh index 7d45035..a3cc525 100644 --- a/03_Completion.zsh +++ b/03_Completion.zsh @@ -1,3 +1,4 @@ +#!/bin/zsh # Fichier de conf pour la personnalisation de la complétion automagique :-) # Hugues HIEGEL # jeu mar 3 10:00:44 CET 2005 diff --git a/04_KeyBindings.zsh b/04_KeyBindings.zsh new file mode 100644 index 0000000..225a2f2 --- /dev/null +++ b/04_KeyBindings.zsh @@ -0,0 +1,38 @@ +#!/bin/zsh +## +## bindkey +## + +bindkey "\e[3~" delete-char # delete +bindkey "\e[2~" overwrite-mode # insert +bindkey "\e[A" up-line-or-history # up +bindkey "\e[B" down-line-or-history # down +bindkey "" history-search-backward # META-up +bindkey "" history-search-forward # META-down +bindkey "\e\e[C" forward-word # ESC right +bindkey "\e\e[D" backward-word # ESC left +bindkey "\e\e[3~" kill-region # ESC del + +#aterm +test $TERM = "rxvt" -o $TERM = "xterm" && +{ + bindkey "\e[1~" beginning-of-line # home + bindkey "\e[4~" end-of-line # end-of-line + bindkey "\eOc" forward-word # CTRL right + bindkey "\eOd" backward-word # CTRL left + bindkey "\e[3$" vi-set-buffer # SHIFT del + bindkey "\eOa" history-search-backward # CTRL UP + bindkey "\eOb" history-search-forward # CTRL DOWN +} +# (gnome-terminal) +test $TERM = "xterm" && +{ + bindkey "\eOH" beginning-of-line # home + bindkey "\eOF" end-of-line # end-of-line +} +#bindkey "\C-t" gosmacs-transpose-chars # J, ca c'est un truc pour toi +# ne pas oublier de s'en servir : +# vi-match-bracket est sur ^X^B par defaut +# npo : quote-region est sur ESC-" par defaut +# npo : which-command est sur ESC-? par defaut + diff --git a/05_Functions.zsh b/05_Functions.zsh new file mode 100644 index 0000000..20384aa --- /dev/null +++ b/05_Functions.zsh @@ -0,0 +1,21 @@ +#!/bin/zsh + +##[[ -t 1 ]] && +chpwd() +{ + case $TERM in + sun-cmd) print -Pn "\e]l%n@%m %~\e\\" ;; + *xterm*|rxvt|(k|E|dt)term|gnome-terminal) print -Pn "\e]0;%n@%m (%l) %~\a" ;; + esac +# print -P "%(/,%78>...>%/,%//)%b" +} + +precmd () +{ +# print -nP "%(?,,%{%}Foirage n°%{%}%?\n)%{%}" +} + +preexec () +{ + # nothing :) +} diff --git a/50_Debug.zsh b/50_Debug.zsh new file mode 100644 index 0000000..08158de --- /dev/null +++ b/50_Debug.zsh @@ -0,0 +1,57 @@ +#!/bin/zsh + +cd_back() { +# for folder in $@ +# do +# cd $(echo $folder | sed "s:[^/]\+:..:g") +# done + cd $1 "" +} + +ldd() +{ + #LDD=$(dlocate ldd | egrep "bin/ldd$" | head -n1 | cut -d' ' -f2) + LDD=/usr/bin/ldd + $LDD $@ | sed "s/\(.*local.*\)/\1/;s/\(.*not found.*\)/\1/" | tr -d ' ' +} + +exports() +{ + if ( [ $# -ne 0 ] ) + then + if ( [ $1 != "-" ] ) + then + export LD_LIBRARY_PATH=${1}/lib + export PKG_CONFIG_PATH=$LD_LIBRARY_PATH/pkgconfig + export ACLOCAL_FLAGS="-I ${1}/share/aclocal" + else + unset LD_LIBRARY_PATH + unset PKG_CONFIG_PATH + unset ACLOCAL_FLAGS + fi + fi + + for i in LD_LIBRARY_PATH PKG_CONFIG_PATH ACLOCAL_FLAGS + do + if ( [ ! -z ${(P)i} ] ) ; then + echo "$i: "${(P)i}"" + else + echo "$i is unset." + fi + done +} + +preexec() +{ + if ( [ "$DEBUG_MODE" = "yes" ] ) + then + fi +} + +precmd() +{ + if ( [ "$DEBUG_MODE" = "yes" ] ) + then + exports + fi +} diff --git a/99_Debug.zsh b/99_Debug.zsh deleted file mode 100644 index 9c73868..0000000 --- a/99_Debug.zsh +++ /dev/null @@ -1,48 +0,0 @@ - -cd_back() { - for folder in $@ - do - cd $(echo $folder | sed "s:[^/]\+:..:g") - done -} - -ldd() -{ - LDD=$(dlocate ldd | egrep "bin/ldd$" | head -n1 | cut -d' ' -f2) - $LDD $@ | sed "s/\(.*local.*\)/\1/;s/\(.*not found.*\)/\1/" | tr -d ' ' -} - -exports() -{ - if ( [ $# -ne 0 ] ) - then - if ( [ $1 != "-" ] ) - then - export LD_LIBRARY_PATH=${1}/lib - export PKG_CONFIG_PATH=$LD_LIBRARY_PATH/pkgconfig - export ACLOCAL_FLAGS="-I ${1}/share/aclocal" - else - unset LD_LIBRARY_PATH - unset PKG_CONFIG_PATH - unset ACLOCAL_FLAGS - fi - fi - - for i in LD_LIBRARY_PATH PKG_CONFIG_PATH ACLOCAL_FLAGS - do - if ( [ ! -z ${(P)i} ] ) ; then - echo "$i: "${(P)i}"" - else - echo "$i is unset." - fi - done -} - -precmd() -{ - if ( [ "$DEBUG_MODE" = "yes" ] ) - then - exports - fi -} - diff --git a/99_Start.zsh b/99_Start.zsh new file mode 100644 index 0000000..a0b8cf0 --- /dev/null +++ b/99_Start.zsh @@ -0,0 +1,6 @@ +#!/bin/zsh + +## +## misc commands +## +chpwd -- cgit v1.2.3