mirror of https://github.com/akelge/zsh
First round of cleanup
This commit is contained in:
parent
8fb766ba35
commit
d48767e51d
|
@ -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
|
||||
|
|
|
@ -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 :
|
||||
|
|
|
@ -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 :
|
|
@ -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 :
|
|
@ -1,2 +0,0 @@
|
|||
LESSPIPE=`whence -p lesspipe || whence -p lesspipe.sh`
|
||||
eval `$LESSPIPE`
|
|
@ -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
|
|
@ -1,2 +0,0 @@
|
|||
LESSPIPE=`whence -p lesspipe || whence -p lesspipe.sh`
|
||||
eval `$LESSPIPE`
|
|
@ -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 :
|
29
zshrc
29
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
|
||||
|
|
Loading…
Reference in New Issue