add script of wifif config for raspberry pi
[dotfiles.git] / zsh / zshrc
index 1ea7de2..994bd71 100644 (file)
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -112,9 +112,19 @@ alias cp='cp -i'
 alias ln='ln -i'
 
 #alias svn='colorsvn'
-alias sed='/usr/local/bin/gsed'
+if [[ $OSNAME == 'Darwin' ]]; then
+    [[ -f '/usr/local/bin/gsed' ]] || echo "zshrc warning: no gsed"
+fi
+[[ -f '/usr/local/bin/gsed' ]] && alias sed='/usr/local/bin/gsed'
 
+##### Git 
+alias 'gs'='git status'
+alias 'ga'='git add'
+alias 'gc'='git commit'
+alias 'gl'='git log  --oneline --graph --all --color --decorate --abbrev-commit'
 alias 'git-log'='git log  --oneline --graph --all --color --decorate --abbrev-commit'
+alias 'gdiff'='git diff'
+alias 'gpush'='git push origin master'
 
 
 
@@ -285,6 +295,7 @@ export MANPATH=$MANPATH:/usr/local/man
 
 export MANPATH=$MANPATH:${HOME}/perl5/man
 export PATH=$PATH:"${HOME}/scripts"
+export PATH=$PATH:"/sbin:/usr/sbin"
 ## hunspell path
 export DICPATH="/usr/local/share/hunspell/"
 
@@ -302,7 +313,7 @@ if [[ $OSNAME == 'Darwin' ]]; then
     export ANDROID_TOOLCHAIN="$ANDROID_NDK_HOME/standalone-toolchain-api14/"
     export ANDROID_HOME="$HOME/android/android-sdk-macosx/"
     export PATH=$PATH:"${ANDROID_TOOLCHAIN}/bin/":"${ANDROID_HOME}/platform-tools/"
-    export PATH="$HOME/bin":"/usr/local/bin":$PATH
+    export PATH="$HOME/bin":"/usr/local/bin":"/usr/local/sbin":$PATH
     
     
     ## appended by cpan initializaion
@@ -312,3 +323,29 @@ if [[ $OSNAME == 'Darwin' ]]; then
     PERL_MB_OPT="--install_base \"$HOME/perl5\""; export PERL_MB_OPT;
     PERL_MM_OPT="INSTALL_BASE=$HOME/perl5"; export PERL_MM_OPT;
 fi
+
+# add Racket into PATH
+export PATH="/Applications/Racket v6.6/bin":$PATH;
+export MANPATH="/Applications/Racket v6.6/man":$MANPATH;
+
+# export ~/.bin into PATH
+export PATH="$HOME/.bin":$PATH;
+
+
+# source Android bin
+[[ -f "$ZSHHOME/androidrc" ]] && . "$ZSHHOME/androidrc"
+
+if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
+export PYENV_ROOT="$HOME/.pyenv"
+export PATH="$PYENV_ROOT/bin:$PATH"
+
+# tmux variable
+export TMUX_IP=`echo $SSH_CONNECTION | awk '{print $3}'`
+if [[ $OSNAME == 'Darwin' ]]; then
+    ip=`ifconfig | grep "inet .*broadcast" | head -1 | awk '{print $2}'`
+    [[ $TMUX_IP = "" ]] && TMUX_IP=$ip
+else
+    ip=`ip addr | grep 'inet .*global' | head -1 | sed 's/^.*inet //g; s/\/.*$//g'`
+    [[ $TMUX_IP = "" ]] && TMUX_IP=$ip
+fi
+