set DEBUG=0 # Set to '1' to get some debugging info set FILE="~/.config/cshrc" set TEXT="Generic .cshrc directives" set VERSION='$Id$' if ( $DEBUG == "1" ) echo "${FILE} (${TEXT}) v${VERSION}" ############################################################################### ### Default settings ########################################################## ############################################################################### unset autologout # Why would I want to auto-logout? unset ignoreeof # ^D should log us out, dammit! umask 022 # Create files with permissions 755 by default set notify # Reports change of status of background processes set history=100 # Remember the last 100 commands set filec # File completion for tcsh set noclobber # Don't replace existing files with ">" redirection unset savehist # History stuff doesn't do me much good setenv HOSTNAME `uname -n | tr A-Z a-z` # Machine hostname ## Trying these out from Russ/Stanford set fignore = ( \~ .o CVS ) ############################################################################### ### Set the default paths ##################################################### ############################################################################### set path = ( /usr/bin /bin /usr/sbin /sbin ); setenv MANPATH "/usr/man:/usr/share/man"; # Basic path areas can be dealt with systematically foreach loc ( local local64 ) if ( -d /usr/$loc/bin ) set path = ( /usr/$loc/bin $path ); if ( -d /usr/$loc/sbin ) set path = ( /usr/$loc/sbin $path ); if ( -d /usr/$loc/X/bin ) set path = ( /usr/$loc/X/bin $path ); if ( -d /usr/$loc/man ) setenv MANPATH /usr/$loc/man:${MANPATH} if ( -d /usr/$loc/share/man ) setenv MANPATH /usr/$loc/share/man:${MANPATH} if ( -d /usr/$loc/shared/man ) setenv MANPATH /usr/$loc/shared/man:${MANPATH} end foreach loc ( sweet pubsw ) if ( -d /usr/$loc/bin ) set path = ( $path /usr/$loc/bin ); if ( -d /usr/$loc/sbin ) set path = ( $path /usr/$loc/sbin ); if ( -d /usr/$loc/X/bin ) set path = ( $path /usr/$loc/X/bin ); if ( -d /usr/$loc/man ) setenv MANPATH ${MANPATH}:/usr/$loc/man if ( -d /usr/$loc/share/man ) setenv MANPATH ${MANPATH}:/usr/$loc/share/man if ( -d /usr/$loc/shared/man ) setenv MANPATH ${MANPATH}:/usr/$loc/shared/man if ( -d $HOME/.config/man ) setenv MANPATH ${MANPATH}:$HOME/.config/man end # Prefix to the path, in reverse order foreach loc ( $HOME/bin $HOME/progs/bin $HOME/.config/bin \ $HOME/progs/bin/$HOSTNAME ) if (-d $loc ) set path = ( $loc $path ); end if (-d $HOME/progs/man) setenv MANPATH $HOME/progs/man:${MANPATH} if (-d $HOME/.config/man) setenv MANPATH $HOME/.config/man:${MANPATH} if (-d /opt/condor/man) set path = ( $path /opt/condor/man ); # Append to the path, in order if (-d /usr/ccs/bin) set path = ( $path /usr/ccs/bin ); if (-d /usr/ucb) set path = ( $path /usr/ucb ); if (-d /usr/kerberos/bin) set path = ( $path /usr/kerberos/bin ); if (-d /usr/bin/X11) set path = ( $path /usr/bin/X11 ); if (-d /usr/lib/news/bin) set path = ( $path /usr/lib/news/bin ); if (-d /opt/condor/bin) set path = ( $path /opt/condor/bin ); # Check the current directory; this may not be a good idea. # set path = ( $path . ); ############################################################################### ### Environment Variables ##################################################### ############################################################################### setenv USERNAME `whoami` # Username setenv HOSTNAME `uname -n | tr A-Z a-z` # Machine hostname setenv HOST `echo $HOSTNAME | sed 's/\..*$//'` # Short hostname setenv DOMAIN `echo $HOSTNAME | awk -F. ' { print $2 } '` # Short domainname setenv OSTYPE `uname` # Operating system type setenv ARCH `uname -m` # Underlying architecture setenv MAIL /var/mail/$USERNAME # Base mailbox setenv PAGER less # Base pager setenv NNTPSERVER news.stanford.edu # News server setenv LYNX_CFG ~/.config/lynx.cfg # Personal lynx configuration setenv EDITOR vi # Backup if we're in csh setenv LESS -aciRMQX~z-2j2 # Pager options make it better # setenv LC_CTYPE en_US.ISO-8859-1 # For best viewing in mutt ## Trying these out from Russ/Stanford as well setenv LANG en_US.UTF-8 setenv LC_ALL en_US.UTF-8 setenv LC_COLLATE C setenv GREP_COLOR 36 ############################################################################### ### OS-specific settings ###################################################### ############################################################################### ## Set the OSHUMAN value, to be used when switching on architecture type setenv OSHUMAN `echo ${OSTYPE} | tr A-Z a-z` if ("${OSHUMAN}" == "sunos") then setenv OSHUMAN "solaris" else if ("${OSHUMAN}" == "SunOS") then setenv OSHUMAN "solaris" else if ("${OSHUMAN}" == "hp-ux") then setenv OSHUMAN "hpux" else if ("${OSHUMAN}" == "irix64") then setenv OSHUMAN "irix" else if ("${OSHUMAN}" == "osf1") then setenv OSHUMAN "tru64" else if ("${OSHUMAN}" == "darwin") then setenv OSHUMAN "macosx" endif ## Load the appropriate cshrc file, by architecture if (-f $HOME/.config/cshrc.$OSHUMAN) source ~/.config/cshrc.$OSHUMAN ############################################################################### ### Additional Configuration ################################################## ############################################################################### set MACHINE="${DOMAIN}.${HOST}" if ($?prompt) then set prompt="%m %~%# " # Prompt is of the "alpha ~> " format if (-e $HOME/.config/alias) source ~/.config/alias if (-e $HOME/.config/alias.${DOMAIN}) source ~/.config/alias.${DOMAIN} if (-e $HOME/.config/alias.${MACHINE}) source ~/.config/alias.${MACHINE} endif if (-e $HOME/.config/cshrc.news) source ~/.config/cshrc.news if (-e $HOME/.config/cshrc.devel) source ~/.config/cshrc.devel if (-e $HOME/.config/cshrc.${DOMAIN}) source ~/.config/cshrc.${DOMAIN} if (-e $HOME/.config/cshrc.${MACHINE}) source ~/.config/cshrc.${MACHINE} unset MACHINE ############################################################################### ### Completions ############################################################### ############################################################################### if ($?prompt) then if ( $DEBUG == "1" ) echo "Loading completions ($HOME/.config/completions*)" if (-e $HOME/.config/completions) source ~/.config/completions if (-e $HOME/.config/completions.local) source ~/.config/completions.local if (-e $HOME/.config/comphosts) then set comp_host_names = (`cat ~/.config/comphosts`) endif if (-e $HOME/.config/cshrc.gnupg) source ~/.config/cshrc.gnupg endif ############################################################################### ### Terminal Configuration #################################################### ############################################################################### ## Trying this out, from Stanford if ($?prompt) then if ( $DEBUG == "1" ) echo "Configuring terminal" # Disable needless delays for special characters. stty cr0 nl0 tab0 ff0 bs0 # Make sure we have sane special character bindings. stty intr '^C' erase '^?' kill '^U' quit '^\' #'# for sh-mode # Standard terminal setup (this should be system independent). (stty >/dev/null) |& grep echoctl >& /dev/null if ($status == 0) stty echoctl ixany -istrip (stty >/dev/null) |& grep echoke >& /dev/null if ($status == 0) stty echoke endif ############################################################################### ### tcsh Configuration ######################################################## ############################################################################### if ($?tcsh) then ## Key Bindings bindkey -v bindkey ^R i-search-fwd bindkey ^F i-search-back ## From Stanford/Russ config; try them out! set autolist = ambiguous set listmax = 100 set nobeep set pushdsilent set pushdtohome set symlinks = ignore set pushdsilent set pushdtohome ## This has to go here so that 'which' works as a command in csh. if ($?prompt) then ## Default editor should be vim if possible, otherwise vi if ( -x `which vim` ) then setenv EDITOR `which vim` else setenv EDITOR vi endif endif endif