#!/bin/csh if ( -r ~/local/csh.pre ) then source ~/local/csh.pre endif set M = `uname -m` set P = `uname -p` set S = `uname -s` set R = `uname -r` if ("$M" == "$P") then set P = '' endif set sysname=`echo $M-$P-$S-$R | tr '[:upper:]' '[:lower:]'` unset R S P M alias lshort 'xdvi `locate lshort.dvi`' switch ("$sysname") # $ case x86_64-*-darwin-*: set sysname='x86_64-darwin' setenv LSCOLORS "dxgxCxdxcxegedabagDeBe" alias ls 'ls -FG' alias top '/usr/bin/top -ocpu -Otime' alias lshort 'locate lshort.pdf | head -1 | xargs open' breaksw case *-i386-darwin-*: set sysname='i386-darwin' setenv LSCOLORS "dxgxCxdxcxegedabagDeBe" alias ls 'ls -FG' alias top '/usr/bin/top -ocpu -Otime' alias lshort 'locate lshort.pdf | head -1 | xargs open' breaksw case *darwin*: set sysname='ppc-darwin' setenv LSCOLORS "dxgxCxdxcxegedabagDeBe" alias ls 'ls -FG' alias top '/usr/bin/top -ocpu -Otime' alias lshort 'locate lshort.pdf | head -1 | xargs open' breaksw case i386--freebsd-*: set sysname='i386-freebsd' setenv LSCOLORS "dxgxCxdxcxegedabagDeBe" alias ls 'ls -FG' if ("$TERM" == "cons25") then # $ if ( -r ~/.freebsd-keymap ) then kbdcontrol -l ~/.freebsd-keymap setenv HOBER_KEYMAP "YES" endif endif breaksw case i386-*-openbsd-*: set sysname='i386-openbsd' alias ls 'ls -F' breaksw case i*86-*-linux-*: set sysname='i386-linux' setenv LS_COLORS 'no=00:fi=00:di=00;33:ln=00;36:pi=00;33:so=01;32:bd=00;34;46:cd=00;34;43:or=00;36:mi=00;36:ex=00;32:*.bat=00;32:*.exe=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:' alias ls 'ls -F --color' setenv LC_COLLATE C breaksw case x86_64-*-linux-*: set sysname='x86_64-linux' setenv LS_COLORS 'no=00:fi=00:di=00;33:ln=00;36:pi=00;33:so=01;32:bd=00;34;46:cd=00;34;43:or=00;36:mi=00;36:ex=00;32:*.bat=00;32:*.exe=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:' alias ls 'ls -F --color' setenv LC_COLLATE C breaksw case *-i386-sunos-*: set sysname='i386-solaris' alias ls 'ls -F' breaksw case *sunos*: set sysname='sparc-solaris' alias ls 'ls -F' breaksw default: set sysname='unknown-unknown' alias ls 'ls -F' breaksw endsw if ( -x /usr/libexec/path_helper ) then eval `/usr/libexec/path_helper -c` endif if ( -d ~/$sysname/bin ) set path = ( ~/$sysname/bin $path ) # $ if ( -d ~/$sysname/sbin ) set path = ( ~/$sysname/sbin $path ) # $ if ( -d ~/@sys/bin ) set path = ( ~/@sys/bin $path ) # $ if ( -d ~/bin ) set path = ( ~/bin $path ) # $ if (`id -un` == `id -gn`) then umask 002 else umask 022 endif setenv TERMINFO ~/.terminfo if ($?TERM) then if ("$TERM" == "xterm") then setenv TERM xterm-color if ( -d /usr/share/terminfo ) then if (`find /usr/share/terminfo -name xterm-256color | wc -l` > 0) then setenv TERM xterm-256color endif endif endif if ( -f /etc/debian_version ) then if ("$TERM" == "xterm-color") setenv TERM xterm # $ endif endif if ($?prompt) then # $ unset ignoreeof unset autologout set notify set filec alias rmb rm -f \*~ .\*~ set rmstar set cdpath = ( ~ ~/code ) set history = 1024 set savehist = 1024 setenv PAGER less setenv TIME "real\t%es\nuser\t%Us\nsys\t%Ss\n" setenv ANT_ARGS "-e" setenv CVS_RSH ssh setenv DARCS_EMAIL 'ted@oconnor.cx' setenv ORGANIZATION "Edward O'Connor " if ( -r ~/.alias ) then source ~/.alias endif alias gnus 'emacs -gnus' alias gnw 'emacs -nw -gnus' if ($?tcsh) then # $ set watch = ( 1 any any ) # I'm nosy. Who's logged in? setenv shlvl 1 if ( -X emacsclient ) then setenv EDITOR emacsclient else if ( -X gnuclient-emacs ) then setenv EDITOR gnuclient-emacs else if ( -X gnuclient ) then setenv EDITOR gnuclient else if ( -X emacs ) then setenv EDITOR emacs else setenv EDITOR vi endif setenv VISUAL $EDITOR # $ bindkey -e bindkey -k up history-search-backward bindkey -k down history-search-forward set prompt = "\n%B%n%b@%B%m%b%# " set promptchars = ":#" if ( -X ledger ) then setenv LEDGER ~/.ledger endif if ( -X nethack ) then setenv NETHACKOPTIONS 'name:Hober, align:neutral, race:Elf, \ role:Rogue, gender:random, fruit:apple, horsename:Kirin, \ dogname:Maggie, color, catname:Molly' endif set complete=enhance complete cd 'p/1/d/' set ssh_hosts = `grep '^Host[ ][^*]' ~/.ssh/config | cut -c 6-` complete ssh 'p/1/$ssh_hosts/' complete sendcfg 'p/*/$ssh_hosts/' foreach host ($ssh_hosts) # $ alias $host "ssh -t $host screen -DR" alias "x$host" "ssh -t $host screen -x" end complete emacs 'n/-L/d/' 'n/-l/f:*.{el,elc}/' \ 'c/--/(batch debug-init no-site-file script eval geometry version)/' \ 'c/-/(-batch -debug-init -no-site-file -script -eval -geometry \ -version d q nw Q L l)/' 'p/*/f/' else setenv EDITOR vi setenv VISUAL $EDITOR # $ set whoami = `whoami` set hn = `hostname` set prompt = "$whoami@$hn (h=\!): " unset whoami unset hn endif if (${?DISPLAY}) then # $ if ( -d ~/local/ ) setenv FVWM_USERDIR ~/local/ endif # http://www.tolaris.com/2011/07/12/reconnecting-your-ssh-agent-to-a-detached-gnu-screen-session/ alias get_ssh_auth_sock "find /tmp/ssh-* -user `whoami` -name agent\* | tail -n 1" if ("$TERM" =~ "screen*") then setenv SSH_AUTH_SOCK `get_ssh_auth_sock` echo "Fixing SSH_AUTH_SOCK [`basename $SSH_AUTH_SOCK`]." endif endif if ( -d ~/web/lib/ ) then source ~/web/lib/atomblog.csh endif if ( -r ~/local/csh.post ) then source ~/local/csh.post endif # .cshrc ends here