Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

194 lines (157 sloc) 4.473 kB
#!/bin/tcsh
# .tcshrc
# A righteous umask
umask 22
# KDE sets IFS to a spurious value
unsetenv IFS
# basic stuff
set path = ($HOME/bin /sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin)
#give lynx a custom configuration
alias lynx 'lynx -nopause -cfg=~/.lynxcfg'
# Remove Emacs Backups
alias reb 'find . -name "*~" -print -exec rm -f {} \;'
# make a directory and change to it
alias mkcd 'mkdir -p \!:1; cd \!:1'
switch (`uname -s`)
case "NetBSD":
alias la 'ls -la'
alias ll 'ls -l'
alias lc 'ls -CF'
setenv DIFF_OPTIONS -urN
set path = ($HOME/bin /sbin /bin /usr/sbin /usr/bin /usr/pkg/sbin /usr/pkg/bin /usr/X11R6/bin)
breaksw
case "FreeBSD":
alias la 'ls -laG'
alias ll 'ls -lG'
alias lc 'ls -CFG'
alias lycd 'lynx /host/localhost/cd/'
alias lycf 'lynx /host/localhost/cf/'
setenv DIFF_OPTIONS -urN
setenv GREP_OPTIONS --colour=auto
breaksw
case "Linux":
alias la 'ls -la --color=auto'
alias ll 'ls -l --color=auto'
alias lc 'ls -CF --color=auto'
alias diff 'diff -urN'
setenv GREP_OPTIONS --colour=auto
breaksw
case "SunOS":
alias la 'ls -la'
alias ll 'ls -l'
alias lc 'ls -CF'
alias diff 'diff -ur'
breaksw
default:
echo Unrecognised system: \"`uname -s`\"
endsw
# some other users (the cd . uses the special alias to reset xterm title)
setenv am_root "NO"
which whoami >/dev/null
if ($? == 0) then
if (`whoami` == root) then
setenv am_root "YES"
endif
endif
if ("${am_root}" == "NO") then
switch (`uname -s`)
case "NetBSD":
case "FreeBSD":
# alias toor 'su -l toor; cd .'
alias toor 'exec su -l toor'
alias root 'exec su -l root'
breaksw
case "Linux":
alias toor 'exec su - toor'
alias root 'exec su - root'
breaksw
case "SunOS":
alias toor 'exec su - toor'
alias root 'exec su - root -c /bin/bash'
breaksw
endsw
endif
unsetenv am_root
alias su 'su \!* ; cd .'
alias edit "eie --no-frame"
alias ed "eie --no-wait"
setenv EDITOR "eie"
foreach value (less more zile ex)
setenv PAGER `which $value`
if (-x "$PAGER") then
if ($value != less) then
alias less "$PAGER"
endif
break
endif
end
setenv BLOCKSIZE M
setenv LESS '-i -R'
setenv LYNX CFG=~/.lynxcfg
# command line completion
set fignore = (.o \~)
# sort out if interactive
if ($?prompt) then
# An interactive shell -- set some stuff up
set filec
set history = 1000
set savehist = 1000
set mail = (/var/mail/$USER)
set autolist
#Keys 2=Insert 3=Delete 5=Page Up 6=Page Down 7=Home 8=End
# normal=~ control=^
# bindkey "^[[2~" delete-char
bindkey "^[[3~" delete-char
bindkey "^[[5~" i-search-back
bindkey "^[[6~" i-search-fwd
bindkey "^[[7~" beginning-of-line
bindkey "^[[8~" end-of-line
bindkey "^R" i-search-back
if (${TERM} == "cons25") then
bindkey "^?" delete-char
endif
set prompt = '%S%m%s:%B%c2%b%% '
which whoami >/dev/null
if ($? == 0) then
if (`whoami` == root) then
set prompt = '%S%m%s:%B%c2%b[%UROOT%u]# '
endif
endif
if (-f /etc/termcap && ${TERM} == "xterm-color" ) then
if (`grep 'xterm-color[:|]' /etc/termcap` == "") then
setenv TERMCAP \
"xterm-color:pa#64:Co#8:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:tc=vt220:"
endif
endif
if (${TERM} != "cons25" && ${TERM} != "linux") then
# auto executes when cd is used
alias cwdcmd 'echo -n "]2;tcsh: ${USER}@${HOST}: $cwd]1;${HOST}"'
cwdcmd
endif
# dd
complete dd c/--/"(help version)"/ c/\[io\]f=/f/ \
c/conv=\*,/"(ascii ebcdic ibm block unblock lcase notrunc ucase swab noerror sync)"/,\
c/conv=/"(ascii ebcdic ibm block unblock \
lcase notrunc ucase swab noerror sync)"/,\
c/\*=/x:'<number>'/ \
n/\*/"(if of conv ibs obs bs cbs files skip file seek count)"/=
# git
if (-d "/usr/local/libexec/git-core") then
set gitcmds = ( `ls -1 /usr/local/libexec/git-core/git-* | sed 's@^/usr/local/.*/git-@@g'` )
complete git "p/1/(${gitcmds})/" \
'n/branch/`git branch|cut -c 3-`/' 'n/co/`git branch|cut -c 3-`/' \
'n/remote/(show add rm prune update)/' 'N/remote/`git remote`/'
unset gitcmds
endif
# for fun
test -x /usr/games/pom && /usr/games/pom
endif
# additional customisation
set auto_start = "${HOME}/bin/AutoStart.*"
ls $auto_start >& /dev/null
if ($status == 0) then
foreach script ($auto_start)
source "${script}"
end
endif
unset auto_start
Jump to Line
Something went wrong with that request. Please try again.