.zsh設定ファイルを全体的にチューニング

diff --git a/.zlogout b/.zlogout
new file mode 100644
index 0000000..da88a34
--- /dev/null
+++ b/.zlogout
@@ -0,0 +1 @@
+toilet -w120 -f mono12.tlf "See you later!"
diff --git a/.zprofile b/.zprofile
new file mode 100644
index 0000000..fd6997f
--- /dev/null
+++ b/.zprofile
@@ -0,0 +1,21 @@
+# Language Settings
+export LANG=ja_JP.UTF-8
+
+# Color Setting
+export LSCOLORS=bxfxcxdxbxegedabagacad
+export LS_COLORS='di=41:ln=35:so=32:pi=33:ex=31:bd=46;31:cd=43;31:su=41;30:sg=46;30:tw=42;30:ow=43;30'
+
+# Path Setting for rbenv
+export PATH=$PATH:$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH
+
+# Path Setting for Homebrew
+export PATH=$PATH:/usr/local/bin:/usr/local/sbin
+
+# Path Setting for Android Tools
+export PATH=$PATH:$HOME/resources/android_sdk/tools:$HOME/android-sdks/platform-tools:
+
+# Path Setting for Unknown
+export PATH=$PATH:$HOME/local/bin:/usr/local/share/npm/bin/:/usr/local/Cellar/
+
+# Default Editor Setting
+export EDITOR="$HOME/local/bin/vim"
diff --git a/.zshenv b/.zshenv
index b10f05d..e69de29 100644
--- a/.zshenv
+++ b/.zshenv
@@ -1,3 +0,0 @@
-
-eval "$(rbenv init -)"
-export PATH="$HOME/.rbenv/bin:$PATH"
diff --git a/.zshrc b/.zshrc
index b50f4f3..87bd778 100644
--- a/.zshrc
+++ b/.zshrc
@@ -1,31 +1,3 @@
-# Load RVM into a shell session *as a function*
-# [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
-PATH=$PATH:$HOME/local/bin:/usr/local/bin
-PATH=$PATH:$HOME/resources/android_sdk/tools
-PATH=$PATH:$HOME/android-sdks/platform-tools
-PATH=$PATH:$HOME/.rbenv/shims
-PATH=$PATH:/usr/local/share/npm/bin/
-PATH=$PATH:/usr/local/sbin
-PATH=$PATH:/usr/local/Cellar/
-
-export FPATH=$FPATH:/usr/local/share/zsh/site-functions
-
-#eval "$(rbenv init -)"
-
-export EDITOR="$HOME/local/bin/vim"
-
-## Environment variable configuration
-#
-# LANG
-#
-export LANG=ja_JP.UTF-8
-case ${UID} in
-0)
-    LANG=C
-    ;;
-esac
-
-
 ## Default shell configuration
 #
 # set prompt
@@ -35,29 +7,29 @@ esac
 autoload -U colors && colors

 function rprompt-git-current-branch {
-        local name st color
-
-        if [[ "$PWD" =~ '/\.git(/.*)?$' ]]; then
-                return
-        fi
-        name=$(basename "`git symbolic-ref HEAD 2> /dev/null`")
-        if [[ -z $name ]]; then
-                return
-        fi
-        st=`git status 2> /dev/null`
-        if [[ -n `echo "$st" | grep "^nothing to"` ]]; then
-                color=${fg[green]}
-        elif [[ -n `echo "$st" | grep "^nothing added"` ]]; then
-                color=${fg[yellow]}
-        elif [[ -n `echo "$st" | grep "^# Untracked"` ]]; then
-                color=${fg_bold[red]}
-        else
-                color=${fg[red]}
-        fi
-
-        # %{...%} は囲まれた文字列がエスケープシーケンスであることを明示する
-        # これをしないと右プロンプトの位置がずれる
-        echo "%{$color%}$name%{$reset_color%} "
+local name st color
+
+if [[ "$PWD" =~ '/\.git(/.*)?$' ]]; then
+  return
+fi
+name=$(basename "`git symbolic-ref HEAD 2> /dev/null`")
+if [[ -z $name ]]; then
+  return
+fi
+st=`git status 2> /dev/null`
+if [[ -n `echo "$st" | grep "^nothing to"` ]]; then
+  color=${fg[green]}
+elif [[ -n `echo "$st" | grep "^nothing added"` ]]; then
+  color=${fg[yellow]}
+elif [[ -n `echo "$st" | grep "^# Untracked"` ]]; then
+  color=${fg_bold[red]}
+else
+  color=${fg[red]}
+fi
+
+# %{...%} は囲まれた文字列がエスケープシーケンスであることを明示する
+# これをしないと右プロンプトの位置がずれる
+echo "%{$color%}$name%{$reset_color%} "
 }
 # プロンプトが表示されるたびにプロンプト文字列を評価、置換する
 setopt prompt_subst
@@ -116,13 +88,6 @@ bindkey "\\en" history-beginning-search-forward-end
 # bindkey "\e[Z" reverse-menu-complete

-## Command history configuration
-#
-HISTFILE=${HOME}/.zsh_history
-HISTSIZE=50000
-SAVEHIST=50000
-setopt hist_ignore_dups     # ignore duplication command history list
-setopt share_history        # share command history data

 ## Completion configuration
@@ -153,25 +118,23 @@ alias where="command -v"
 alias j="jobs -l"

 case "${OSTYPE}" in
-freebsd*|darwin*)
+  freebsd*|darwin*)
     alias ls="ls -G -w"
     ;;
-linux*)
+  linux*)
     alias ls="ls --color"
     ;;
 esac

 ## terminal configuration
-export LSCOLORS=bxfxcxdxbxegedabagacad
-export LS_COLORS='di=41:ln=35:so=32:pi=33:ex=31:bd=46;31:cd=43;31:su=41;30:sg=46;30:tw=42;30:ow=43;30'
 zstyle ':completion:*' list-colors 'di=41' 'ln=35' 'so=32' 'ex=31' 'bd=46;34' 'cd=43;31'

 # set terminal title including current directory
 #
 case "${TERM}" in
-xterm|xterm-color|kterm|kterm-color)
+  xterm|xterm-color|kterm|kterm-color)
     precmd() {
-        echo -ne "\033]0;${USER}@${HOST%%.*}:${PWD}\007"
+      echo -ne "\033]0;${USER}@${HOST%%.*}:${PWD}\007"
     }
     ;;
 esac
@@ -192,15 +155,21 @@ alias df="df -h"
 alias su="su -l"
 alias monit="ssh docci_monit01"

-# ================================================================
-# tmux alias
-# ================================================================
 tmux-att() { tmux attach-session -t $1 }

 # Mailtrapのログを文字コード変換して
 alias mailtrap_log="tail -F /var/tmp/mailtrap.log | perl -MEncode -pe '\$_ = encode(\"utf-8\", decode(\"iso-2022-jp\", \$_))"

 # ================================================================
+# History configuration
+# ================================================================
+HISTFILE=${HOME}/.zsh_history
+HISTSIZE=50000
+SAVEHIST=50000
+setopt hist_ignore_dups     # ignore duplication command history list
+setopt share_history        # share command history data
+
+# ================================================================
 # Finderでのファイルの表示・非表示トグル
 # ================================================================
 toggle_hidden_files() {
@@ -218,3 +187,10 @@ toggle_hidden_files() {
   echo restarting Finder
   sudo killall Finder
 }
+
+# ================================================================
+# zsh-completions
+# ================================================================
+export FPATH=$FPATH:/usr/local/share/zsh/site-functions
+
+eval "$(rbenv init -)"

diff --git a/setup.sh b/setup.sh
index 622237e..b4377a2 100644
--- a/setup.sh
+++ b/setup.sh
@@ -1,4 +1,4 @@
-files=('.tmux.conf' '.zlogin' '.zshenv' '.zshrc')
+files=('.tmux.conf' '.zlogin' '.zshenv' '.zshrc' '.zlogout' '.zprofile')

 for f in "${files[@]}"
 do

diff --git a/.zshrc b/.zshrc
index 87bd778..23fd45c 100644
--- a/.zshrc
+++ b/.zshrc
@@ -193,4 +193,11 @@ toggle_hidden_files() {
 # ================================================================
 export FPATH=$FPATH:/usr/local/share/zsh/site-functions

-eval "$(rbenv init -)"
+# ================================================================
+# Version Control for Languages
+# ================================================================
+# rbenv
+if which rbenv > /dev/null; then
+  eval   "$(rbenv init - zsh)"
+  # source "`$brew --prefix rbenv`/completions/rbenv.zsh"
+fi