# $Id$ # # csh/tcsh .cshrc file ########################### # Common settings for All # ########################### set path=() foreach i (/bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/X11R6/bin $HOME/bin) if (-d $i) set path=($i $path) end unset i switch ($USER) case "hideishi" umask 077 breaksw default umask 022 breaksw endsw setenv BLOCKSIZE K setenv LC_TIME C ########################### # Setting aliase # ########################### set cdpath=(/sys /sys/arch /usr/src/{bin,sbin,usr.{bin,sbin},pgrm,lib,libexec,share,contrib,local,devel,games,old,gnu,gnu/{lib,usr.bin,usr.sbin,libexec}}) alias cd 'set old="$cwd"; chdir \!*' alias back 'set back="$old"; set old="$cwd"; cd "$back"; unset back; dirs' alias pd pushd alias pd2 pushd +2 alias pd3 pushd +3 alias pd4 pushd +4 alias first 'awk \{print\ \$1\}' alias second 'awk \{print\ \$2\}' alias third 'awk \{print\ \$3\}' alias final 'awk \{print\ \$NF\}' alias unmask '( umask 022; \!* )' alias h history 25 alias j jobs -l alias ls ls -F alias la ls -a alias lf ls -FA alias ll ls -lAF alias a awk alias c cat alias d diff alias g grep alias p ps -ax if (-x /usr/local/bin/ssh) then alias ssh '/usr/local/bin/ssh -P' else if (-x /usr/bin/ssh) then alias ssh '/usr/bin/ssh -P' endif which mutt >& /dev/null && alias mutt 'env LANG=C mutt' which tgif >& /dev/null && alias tgif tgif =720x540 which lame >& /dev/null && alias lame lame -h -v --vbr-new -V 2 if (-s /etc/fstab) then egrep softdep /etc/fstab >& /dev/null if ( $status == 0 ) then alias df 'sync && /bin/df \!*' endif endif ########################################## # PAGER settings (IF jless IS INSTALLED) # ########################################## if (-x /usr/local/bin/jless) then setenv PAGER '/usr/local/bin/jless -s' if ("`uname`" == "OpenBSD") then setenv JLESSCHARSET japanese else setenv JLESSCHARSET japanese-euc endif alias l /usr/local/bin/jless alias s '/usr/local/bin/jless -S' if (-x /usr/local/bin/jlessecho) then setenv LESSECHO /usr/local/bin/jlessecho endif else setenv PAGER more endif ########################################## # EDITOR settings (IF jvim IS INSTALLED) # ########################################## if (-x /usr/local/bin/vim) then setenv EDITOR /usr/local/bin/vim alias vi /usr/local/bin/vim alias v /usr/local/bin/vim setenv EXINIT 'se ai sm smd nobk fc fk=J' else if (-x /usr/local/bin/jvim) then setenv EDITOR /usr/local/bin/jvim alias vi /usr/local/bin/jvim alias v /usr/local/bin/jvim setenv EXINIT 'se ai sm smd nobk' else setenv EDITOR /usr/bin/vi alias v vi setenv EXINIT 'se ai sm smd' endif ######################### # OS dependent settings # ######################### switch ("`uname`") case "FreeBSD" if ($?DISPLAY) then setenv XMODIFIERS '@im=skkinput' setenv LANG ja_JP.EUC else setenv LANG C endif if ("`uname -r`" == "5.0-CURRENT") then alias apm sysctl hw.acpi endif alias pkg_obsolete 'pkg_version -v | egrep \<\|\>\|\\\?' breaksw case "OpenBSD" setenv LANG C setenv CVS_RSH /usr/bin/ssh setenv CVSROOT anoncvs@anoncvs.jp.openbsd.org:/cvs setenv GS_LIB /usr/local/share/ghostscript/6.51/lib:/usr/local/share/ghostscript/fonts breaksw endsw ########################### # HOST dependent settings # ########################### switch ("`hostname -s`") case "melchior" setenv ftp_proxy http://192.168.1.254:3128/ setenv SKKSERVER 192.168.1.1 breaksw case "casper" setenv ftp_proxy http://192.168.1.254:3128/ breaksw case "balthasar" setenv ftp_proxy http://192.168.1.254:3128/ setenv SKKSERVER 192.168.1.1 which w3m >& /dev/null && alias w3m 'w3m -e -no-proxy' breaksw case "rei*" if ("`cat /.istype`" == "home") then setenv ftp_proxy http://192.168.1.254:3128/ setenv CVSROOT cvsup@casper:/raid0/ctm/OpenBSD/cvs which w3m >& /dev/null && alias w3m 'w3m -e' #if (-x /usr/local/libexec/w3m/w3mimgdisplay) then # alias w3m 'w3m -e -ppc 7 -ppl 113' #else # alias w3m 'w3m -e' #endif else which w3m >& /dev/null && alias w3m 'w3m -e -no-proxy' #if (-x /usr/local/libexec/w3m/w3mimgdisplay) then # alias w3m 'w3m -e -ppc 7 -ppl 113 -no-proxy' #else # alias w3m 'w3m -e -no-proxy' #endif endif which timidity >& /dev/null && \ alias timidity 'timidity -a -U -teuc -inqst' which emacs >& /dev/null && \ alias irc emacs -f irchat which fetchmail >& /dev/null && \ alias fetchdaemon 'fetchmail -d 90' && \ alias fetchkill 'fetchmail -q' alias irclog 'set chan="\!*"; w3m http://www.magisystem.net/cgi-bin/irclog/$chan/`date "+%Y%m%d"`; unset chan' complete irclog 'p/1/(chibug dammen)/' #alias cvslog 'set root="\!*"; w3m http://casper.ipv6.magisystem.net/cgi-bin/cvsweb\?cvsroot=$root; unset root' #complete cvslog 'p/1/(freebsd openbsd)/' alias cvslog 'w3m http://casper.ipv6.magisystem.net/cgi-bin/cvsweb/\!^' breaksw endsw #################################################### # Login shell settings (with tcsh dependent stuff) # #################################################### if ($?prompt) then set filec #set autolist set ignoreeof set noclobbler set history=500 set fignore=(\~ .o) set mail=(180 /var/mail/$USER) if ($?tcsh) then set savehist=(500 merge) if ($USER == "root") then set prompt="%h [%m:%B%c%b]# " else #set prompt="%h [%m:%B%c%b]% " set prompt="[%l%%%m:%B%c%b]% " endif set autoexpand set color bindkey ^R i-search-back #bindkey ^X i-search-fwd bindkey ^W backward-delete-word complete alias 'p/1/a/' complete cd 'p/1/d/' complete man 'p/*/c/' complete which 'p/1/c/' complete set 'p/1/s/' complete kill 'p/*/`ps | awk \{print\ \$1\}`/' complete pkg_info 'p@*@`/bin/ls /var/db/pkg | awk \{print\ \$1\}`@' complete pkg_delete 'p@*@`/bin/ls /var/db/pkg | awk \{print\ \$1\}`@' complete pkg_add 'p/*/f:*.tgz/' complete sysctl 'p/*/`sysctl -a | awk -F ": " \{print\ \$1\}`/' which mpg123 >& /dev/null && complete mpg123 'p/*/f:*.[mM][pP]3/' which platex >& /dev/null && complete platex 'p/*/f:*.tex/' #which w3m >& /dev/null && complete w3m 'p@*@(http:// ftp://)@@' which sudo >& /dev/null && complete sudo 'p/1/c/' #complete ssh 'p/*/`awk -F "," \{print\ \$1\} < ~/.ssh/known_hosts`/' complete ssh 'p@*@`awk \{print\ \$1\} < $HOME/.ssh/known_hosts | awk -F , \{print\ \$1\}`@' complete ftp 'p@*@`awk /machine/\ \{print\ \$2\} < $HOME/.netrc`@' else set savehist=500 if ($USER == "root") then set prompt="! [`hostname -s`]# " else set prompt="! [`hostname -s`]% " endif endif endif