# .cshrc
# $Id: dot.cshrc,v 1.1 1999/12/08 23:49:09 miyo Exp jq6fpd $

set path=(~/conf/bin \
        /usr/local/gnu/bin\
        /usr/local/emacs21/bin\
        /usr/local/bin  \
	/usr/bin \
	/bin\
        /usr/{X11,X11R6}/bin /usr/local/X11/bin \
        /usr/bin/X11 /usr/local/bin/X11 \
        /usr/local/mh\
        /usr/sbin /sbin /usr/local/sbin \
        /usr/local/pbmplus /usr/include/X11/extensions\
        /usr/local/jdk/bin \
        /usr/local/javacc/bin \
        /usr/local/ant/bin \
        /import/neo/usr.local/jdk/bin \
        /usr/local/h8300/bin \
        /usr/local/JFlex/bin \
        /usr/local/starsuite6.0/program\
        /usr/local/pgsql/bin\
        /usr/local/superh/bin \
        /ust/local/h8tools \
        /usr/local/bin/im)

if ( -f /sw/bin/init.sh ) then
	source /sw/bin/init.csh
	setenv PATH ~/conf/bin:/usr/local/bin:$PATH
endif

if ($?prompt == 0) exit
endif

setenv SHELL tcsh

if (`uname` == CYGWIN_NT-5.1 ) then
	setenv TERM xterm
else
	limit stack 8192
	limit core 0
	umask 022
	limit coredumpsize 0
endif

stty erase ^H  kill ^U
umask 022

setenv PAGER less
setenv EDITOR vi
setenv LESSCHARSET japanese-euc

if ($TERM == kterm) then 
	setenv LANG ja_JP.EUC
else
	setenv LANG C
endif

setenv CVSROOT /home/ariel/project/cvsroot
setenv CVSEDITOR 'emacs -nw'
setenv LD_LIBRARY_PATH .

setenv CLASSPATH ~/lib/java/bsh.jar
setenv CLASSPATH ~/lib/java/mjlib.jar:$CLASSPATH
setenv CLASSPATH ~/lib/java/sgn.jar:$CLASSPATH
setenv CLASSPATH .:$CLASSPATH
setenv JAVA_HOME /usr/local/jdk
setenv ANT_HOME /usr/local/ant

set ignoreeof

switch (`uname`)
	case  CYGWIN_NT-5.1
		alias ls 'ls-F -G'
		breaksw
	default:
		alias ls 'ls-F'
endsw

alias ll 'ls -l'
alias la 'ls -a'
alias sl 'ls -F'
alias mv 'mv -i'
alias cp 'cp -i'
alias mem 'du -s '
alias mnews 'mnews -e'
alias f 'from'

if (`uname` == FreeBSD || `uname` == Darwin) then
	setenv HOSTNAME `hostname -s`
else
	setenv HOSTNAME ${HOST}
endif

if ( -x /usr/local/bin/dircolors || -x /usr/bin/dircolors ) then
	eval `dircolors -c $HOME/conf/dircolors`
else if ( -x /usr/local/bin/gdircolors || -x /usr/bin/gdircolors ) then
	eval `gdircolors -c $HOME/conf/dircolors`
endif

if ($TERM == kterm) then
	alias cwdcmd 'echo -n "]2;${HOSTNAME}:$cwd "'
endif

if ($?tcsh) then

	switch (${HOSTNAME})
		case beer
		case olive
			set prompt="%{^[[31m%}`whoami`@${HOSTNAME}%{^[[m%}:%% "
			set rprompt="%{^[[m%} %~%{^[[m%}"
			breaksw
		case yeti
		case brandy
			set prompt="%{^[[32m%}`whoami`@${HOSTNAME}%{^[[m%}:%% "
			set rprompt="%{^[[m%} %~%{^[[m%}"
			breaksw
		case ringo
		case cidre
			set prompt="%{^[[33m%}`whoami`@${HOSTNAME}%{^[[m%}:%% "
			set rprompt="%{^[[m%} %~%{^[[m%}"
			breaksw
		case korin
		case mobi
		case penne 
			set prompt="%{^[[35m%}`whoami`@${HOSTNAME}%{^[[m%}:%% "
			set rprompt="%{^[[m%} %~%{^[[m%}"
			breaksw
		case ariel
		case smirnoff
		case kilimanjaro
			set prompt="%{^[[36m%}`whoami`@${HOSTNAME}%{^[[m%}:%% "
			set rprompt="%{^[[m%} %~%{^[[m%}"
			breaksw
		default:
			set prompt="%{^[[37m%}`whoami`@${HOSTNAME}%{^[[m%}:%% "
			set rprompt="%{^[[m%} %~%{^[[m%}"
	endsw

	set color
	unset autologout
	set savehist = (1000 merge)
	set listlinks
	set autolist
	bindkey "^P" history-search-backward 
	bindkey "^N" history-search-forward 
	complete unset 'p/1/s/'
	complete unsetenv 'p/1/e/'
	complete platex 'p/1/f:*.tex/'
	complete tar 'p/2/f:*.{tar.gz,tar.bz2,tgz,tar.Z,tbz}/'
	complete '-scr*' 'p/0/(screen)/'

	set ftphosts=(bsd.noc.titech.ac.jp ftp.kddlabs.co.jp neo ftp.isc.org)
	complete lftp 'n/*/$ftphosts/'
	set unixhosts=(\
		neo morpheus ariel goemon nagasaki hoehoe chika haha alpha olive)
	complete {xon,rsh,rlogin} 'p/1/$unixhosts/'
	set cvsoption=(update commit checkout add remove)
	complete cvs 'p/1/$cvsoption/'
	complete dd c/if=/f/ c/of=/f/ # if=
else 
	set prompt="`whoami`@$HOSTNAME:%~ % "
	set filec
endif

if (`uname` == CYGWIN_NT-5.1 ) then
else
	mesg y
endif
cd .
