diff --git a/antibody/zshrc.antibody b/antibody/zshrc.antibody index 221411d..cc91128 100644 --- a/antibody/zshrc.antibody +++ b/antibody/zshrc.antibody @@ -1,54 +1,10 @@ # Created by newuser for 5.7.1 # export DEFAULT_USER=$(whoami) -# export WORKON_HOME=$HOME/Src/virtualenvs export PROJECT_HOME=$HOME/Src/projects -export SHOW_AWS_PROMPT=false - ZSH="$(antibody home)/https-COLON--SLASH--SLASH-github.com-SLASH-robbyrussell-SLASH-oh-my-zsh" source ~/.zshdir/plugins.sh -prompt_dir() { - prompt_segment blue black ' %3~' -} - - -#AWS Profile: -# - display current AWS_PROFILE name -# - displays yellow on red if profile name contains 'production' or -# ends in '-prod' -# - displays black on green otherwise -prompt_aws_profile() { - local aws_profile="$AWS_PROFILE" - if [[ -n $aws_profile ]]; then - if [[ $aws_profile == "prod"* || $aws_profile == "production"* ]]; then - prompt_segment green yellow " $aws_profile" - else - prompt_segment green black " $aws_profile" - fi - fi -} - -prompt_context() { - local user=`whoami` - if [[ "$user" != "$DEFAULT_USER" || -n "$SSH_CONNECTION" ]] - then - prompt_segment $PRIMARY_FG default " %(!.%{%F{yellow}%}.)$user@%m " - fi - prompt_segment $PRIMARY_FG default "%{\e]2;%m:%.\a%}" - prompt_aws_profile -} - -build_prompt() { - RETVAL=$? - prompt_status - prompt_virtualenv - prompt_aws_profile - prompt_context - # prompt_dir - prompt_git -} - cd diff --git a/zsh.d/30-less.zsh b/zsh.d/30-less.zsh index f8ac5f0..d35de3e 100644 --- a/zsh.d/30-less.zsh +++ b/zsh.d/30-less.zsh @@ -17,4 +17,8 @@ PAGER=/usr/bin/less export LESS export PAGER + +LESSPIPE=`whence -p lesspipe || whence -p lesspipe.sh` +eval `$LESSPIPE` + # vim: set ts=4 sw=4 tw=0 ft=zsh : diff --git a/zsh.d/Darwin/80-macportsDarwin.zsh b/zsh.d/Darwin/80-macportsDarwin.zsh deleted file mode 100644 index df77e68..0000000 --- a/zsh.d/Darwin/80-macportsDarwin.zsh +++ /dev/null @@ -1,52 +0,0 @@ -# Mac Ports -[ ! -d /opt/local ] && return - -# Setup PATH -if [ -z "$PATH" ]; then - PATH=/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:~/bin -else - PATH=/opt/local/bin:/opt/local/sbin:$PATH -fi -export PATH - -# # Setup MANPATH -# if [ -z "$MANPATH" ]; then - # MANPATH=`/usr/bin/manpath` -# fi -# MANPATH=/opt/local/man:$MANPATH -# export MANPTH - -# # Setup INFOPATH -# if [ -z "$INFOPATH" ]; then - # INFOPATH=/opt/local/share/info:/opt/local/info:/usr/share/info -# else - # INFOPATH=/opt/local/share/info:/opt/local/info:$INFOPATH -# fi -# export INFOPATH - -if [ -z "$PERL5LIB" ]; then - PERL5LIB=/opt/local/lib/perl5:/opt/local/lib/perl5/darwin -else - PERL5LIB=/opt/local/lib/perl5:/opt/local/lib/perl5/darwin:$PERL5LIB -fi -export PERL5LIB - -# Add X11 paths (but only if the directories are readable) -if [ -r /usr/X11R6/bin ]; then - PATH=$PATH:/usr/X11R6/bin - export PATH -fi -# if [ -r /usr/X11R6/man ]; then - # MANPATH=$MANPATH:/usr/X11R6/man - # export MANPATH -# fi - -# PY_VER="2.7" - -# PYTHONPATH="/opt/local/lib/python/site-packages:/opt/local/Library/Frameworks/Python.framework/Versions/${PY_VER}/lib/python${PY_VER}/site-packages/" -# #PYTHONHOME="/opt/local/Library/Frameworks/Python.framework/Versions/${PY_VER}" - -# export PYTHONPATH -#export PYTHONHOME - -# vim: set ts=4 sw=4 tw=0 ft=zsh : diff --git a/zsh.d/Darwin/90-dsFunctions.zsh.off b/zsh.d/Darwin/90-dsFunctions.zsh.off deleted file mode 100644 index cd6be69..0000000 --- a/zsh.d/Darwin/90-dsFunctions.zsh.off +++ /dev/null @@ -1,25 +0,0 @@ -BASE='/LDAPv3/dioniso.cube.lan' -KEYWORD="desktop" - -function dsComputerUserList { - for c in `dscl $BASE -search Computers Keywords desktop|grep Keywords|cut -f1|sort`; do - echo -n $c: - dscl $BASE -read Computers/$c Comment|cut -d: -f3 - done -} - -function dsComputerList { - for c in `dsComputerUserList`; do - echo $c|cut -d: -f1 - done -} - -function dsUser { - COMPUTER=${1-`dscl . -list Computers|grep -v localhost`} - dsComputerUserList| grep -i $COMPUTER|cut -d: -f2 -} - -unset BASE -unset KEYWORD - -# vim: set ts=4 sw=4 tw=0 ft=zsh : diff --git a/zsh.d/Darwin/90-less.zsh b/zsh.d/Darwin/90-less.zsh deleted file mode 100644 index 85adc1f..0000000 --- a/zsh.d/Darwin/90-less.zsh +++ /dev/null @@ -1,2 +0,0 @@ -LESSPIPE=`whence -p lesspipe || whence -p lesspipe.sh` -eval `$LESSPIPE` diff --git a/zsh.d/Darwin/mvim.diff b/zsh.d/Darwin/mvim.diff deleted file mode 100644 index 047b5d2..0000000 --- a/zsh.d/Darwin/mvim.diff +++ /dev/null @@ -1,47 +0,0 @@ ---- mvim~ 2013-07-09 21:55:06.000000000 +0200 -+++ mvim 2013-07-07 21:24:15.000000000 +0200 -@@ -13,6 +13,8 @@ - # or by un-commenting and editing the following line: - # VIM_APP_DIR=/Applications - -+tabs=true -+ - if [ -z "$VIM_APP_DIR" ] - then - myDir="`dirname "$0"`" -@@ -58,15 +60,26 @@ - esac - - # Last step: fire up vim. --# The program should fork by default when started in GUI mode, but it does --# not; we work around this when this script is invoked as "gvim" or "rgview" --# etc., but not when it is invoked as "vim -g". - if [ "$gui" ]; then -- # Note: this isn't perfect, because any error output goes to the -- # terminal instead of the console log. -- # But if you use open instead, you will need to fully qualify the -- # path names for any filenames you specify, which is hard. -- exec "$binary" -g $opts ${1:+"$@"} -+ if $tabs && [[ `$binary --serverlist` = "VIM" ]]; then -+ exec "$binary" -g $opts --remote-tab-silent ${1:+"$@"} -+ else -+ exec "$binary" -g $opts ${1:+"$@"} -+ fi - else -- exec "$binary" $opts ${1:+"$@"} -+ exec "$binary" $opts ${1:+"$@"} - fi -+ -+# # Last step: fire up vim. -+# # The program should fork by default when started in GUI mode, but it does -+# # not; we work around this when this script is invoked as "gvim" or "rgview" -+# # etc., but not when it is invoked as "vim -g". -+# if [ "$gui" ]; then -+ # # Note: this isn't perfect, because any error output goes to the -+ # # terminal instead of the console log. -+ # # But if you use open instead, you will need to fully qualify the -+ # # path names for any filenames you specify, which is hard. -+ # exec "$binary" -g $opts ${1:+"$@"} -+# else -+ # exec "$binary" $opts ${1:+"$@"} -+# fi diff --git a/zsh.d/Linux/90-less.zsh b/zsh.d/Linux/90-less.zsh deleted file mode 100644 index 85adc1f..0000000 --- a/zsh.d/Linux/90-less.zsh +++ /dev/null @@ -1,2 +0,0 @@ -LESSPIPE=`whence -p lesspipe || whence -p lesspipe.sh` -eval `$LESSPIPE` diff --git a/zsh.d/prompts/prompt_server2_setup b/zsh.d/prompts/prompt_server2_setup deleted file mode 100644 index 593f23e..0000000 --- a/zsh.d/prompts/prompt_server2_setup +++ /dev/null @@ -1,19 +0,0 @@ -function prompt_server2_setup { -# Setup PROMPT -if `fancyTerm`; then - # We are on xterminal - W="%n@%m:%." - I="%m:%." - L="%B@%m %4(~:...:)%3~ %#%b " - PS1="%{]2;$W%}%{]1;$I%}$L" - unset W I L - -else - # We are not on xterminal - PS1="%B%n@%m:%~ %#%b " -fi -} - -prompt_server2_setup - -# vim: set ts=4 sw=4 tw=0 ft=zsh : diff --git a/zshrc b/zshrc index cf0bb72..346dff2 100644 --- a/zshrc +++ b/zshrc @@ -11,16 +11,10 @@ # [ -d /etc/zsh ] && BASE="/etc/zsh" || BASE="/etc" +# If there is a .zsh directory into user's home, use that one instead (local install) [ -d ~/.zsh ] && BASE=~/.zsh -KERNEL=`uname -s` -LIBRARY=${BASE}/zsh.d -KERNLIB=${LIBRARY}/${KERNEL} - function loadRC { - # [ -d $1 ] && cd $1 || exit 1 - # - if [ -d $1/zshfunctions ]; then fpath=($1/zshfunctions $fpath) fi @@ -29,8 +23,7 @@ function loadRC { fpath=($1/completions $fpath) fi - # Add local customization file, svn ignored - # if [ $EUID -eq 0 ]; then + # Add local customization file if [ -w $1 ]; then [ -f $1/99-local.zsh ] || echo "# Local customizations" > $1/99-local.zsh fi @@ -39,21 +32,11 @@ function loadRC { for zshFile in $1/[0-9]*.zsh; do . $zshFile done - - unset zshFile } +local KERNEL=`uname -s` +local LIBRARY=${BASE}/zsh.d +local KERNLIB=${LIBRARY}/${KERNEL} + loadRC ${LIBRARY} loadRC ${KERNLIB} - -unset KERNEL -unset LIBRARY -unset KERNLIB - -# Local (per Host) customizations -for localDir in ${LIBRARY} /etc/zsh /etc /usr/local/etc /usr/local/etc/zsh; do - if [ -f ${localDir}/zshrc.local ]; then - . ${localDir}/zshrc.local - fi -done -unset localDir