(display-time)
;; Setting for Frames ----------------------------------------------------------
+(when window-system
+ (set-default-font "Bitstream Vera Sans Mono 11")
+ (set-fontset-font (frame-parameter nil 'font)
+ 'japanese-jisx0208
+ '("Hiragino Kaku Gothic Pro W3" . "unicode-bmp")))
;; Hooks for newline-and-indent ------------------------------------------------
(mapcar (lambda (hook)
}
function chpwd() { # Hook
- local dirinfo=$(print_directory_info)
+ local dirinfo=$(print_directory_info $(pwd))
case $dirinfo in
"")
}
function print_directory_info() {
- local vcs_type=$(print_vcs_type $(pwd))
-
- case $vcs_type in
- git)
- git branch --no-color 2>/dev/null \
- | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/';;
- hg)
- hg branch 2>/dev/null;;
- darcs-*)
- # Delete `darcs-' at the beginning.
- echo ${vcs_type#darcs-};;
- *)
- # Unknown
- echo
- esac
-}
-
-function print_vcs_type() {
local absdir=$1
if [[ -d $absdir/.git ]] then
- echo git
+ # Git
+ git branch --no-color 2>/dev/null \
+ | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
+
elif [[ -d $absdir/.hg ]] then
- echo hg
+ # Hg
+ hg branch 2>/dev/null
+
elif [[ -d $absdir/_darcs ]] then
- echo darcs-$(basename $absdir)
+ # Darcs
+ basename $absdir
+
else
- # Nothing.
+ # Unknown.
if [[ $absdir = "/" ]] then
# This is the root directory so exit from the recursion.
echo
else
# Recurse to the parent dir.
- print_vcs_type $(dirname $absdir)
+ print_directory_info $(dirname $absdir)
fi
fi
}