Mercurial > ec-dotfiles
comparison rc/cshrc @ 332:db66d53e10ea
Canonical name for configs.
| author | Edho Arief <edho@myconan.net> |
|---|---|
| date | Mon, 19 Mar 2012 12:52:12 +0700 |
| parents | rc/tcsh@e59a766d5fa3 |
| children | 675590e84904 |
comparison
equal
deleted
inserted
replaced
| 331:00777bea96fb | 332:db66d53e10ea |
|---|---|
| 1 #!/usr/bin/env tcsh | |
| 2 | |
| 3 # Ensures it's tcsh | |
| 4 if ( ! $?tcsh ) then | |
| 5 exit | |
| 6 endif | |
| 7 | |
| 8 # Ensures this script is running on terminal. Otherwise exit immediately. | |
| 9 if ( ! $?prompt ) then | |
| 10 exit | |
| 11 endif | |
| 12 | |
| 13 # Ensures we're not loading this script again. | |
| 14 if ( ! $?ecos_tcsh_loaded ) then | |
| 15 set ecos_tcsh_loaded="yes" | |
| 16 else | |
| 17 exit | |
| 18 endif | |
| 19 | |
| 20 test -f "${HOME}/.ecos_tcsh.before" && source "${HOME}/.ecos_tcsh.before" | |
| 21 umask 22 | |
| 22 limit coredumpsize 0 | |
| 23 | |
| 24 set prompt="[%B%n@%m %~%b]%# " | |
| 25 set path=({,/usr}/{bin,sbin} "${HOME}"/{,.ecos_}bin) | |
| 26 set history=1000 | |
| 27 set savehist=1000 | |
| 28 set nobeep | |
| 29 set filec | |
| 30 | |
| 31 setenv EDITOR vi | |
| 32 setenv PAGER less | |
| 33 setenv BLOCKSIZE K | |
| 34 setenv LC_COLLATE C | |
| 35 setenv LANG en_US.UTF-8 | |
| 36 | |
| 37 unset autologout | |
| 38 unset autoexpand | |
| 39 unset autolist | |
| 40 unset ignoreeof | |
| 41 | |
| 42 unalias \* | |
| 43 alias rd "rdesktop -g 1280x700 -K -a 16 -z -P -r sound:off -r clipboard:CLIPBOARD -5" | |
| 44 alias h history 25 | |
| 45 alias j jobs -l | |
| 46 alias la ls -A | |
| 47 alias ll ls -lA | |
| 48 alias ls ls -F | |
| 49 alias rm rm -i | |
| 50 | |
| 51 if ($?prompt) then | |
| 52 set gnuls_opts="--color=auto --group-directories-first -F" | |
| 53 set iscolor=0 | |
| 54 switch (${TERM}) | |
| 55 case xterm*: | |
| 56 case dtterm: | |
| 57 case screen*: | |
| 58 setenv CLICOLOR | |
| 59 set myhost=`hostname | cut -d '.' -f 1` | |
| 60 set prompt="[%{\033[0;33m%}%n%{\033[0m%}@%{\033[0;32m%}%m%{\033[0m%} %{\033[0;34m%}%c%{\033[0m%}]%# " | |
| 61 alias mypwd 'printf "%s\n" "${PWD}" | sed -e "s#^${HOME}#~#"' | |
| 62 alias precmd 'printf "\033]0;${USER}@${myhost}: %s\007" "`mypwd`"' | |
| 63 set iscolor=1 | |
| 64 breaksw | |
| 65 endsw | |
| 66 | |
| 67 if ("$TERM" == "screen") then | |
| 68 bindkey '\e[1~' beginning-of-line | |
| 69 bindkey '\e[3~' delete-char | |
| 70 bindkey '\e[4~' end-of-line | |
| 71 bindkey '\e[5~' history-search-backward | |
| 72 bindkey '\e[6~' history-search-forward | |
| 73 bindkey '\eOD' backward-word | |
| 74 bindkey '\eOC' forward-word | |
| 75 bindkey '\e\e[D' backward-word | |
| 76 bindkey '\e\e[C' forward-word | |
| 77 endif | |
| 78 bindkey "^W" backward-delete-word | |
| 79 bindkey -k up history-search-backward | |
| 80 bindkey -k down history-search-forward | |
| 81 endif | |
| 82 | |
| 83 switch (`uname -s`) | |
| 84 case FreeBSD: | |
| 85 set path=(${path} /usr/local/{bin,sbin}) | |
| 86 setenv LSCOLORS "exfxcxdxbxegedabagacad" | |
| 87 alias ls ls -FG | |
| 88 ( which gnuls ) > /dev/null && alias ls gnuls ${gnuls_opts} | |
| 89 alias man man -o | |
| 90 alias rm rm -I | |
| 91 alias top top -P | |
| 92 breaksw | |
| 93 case NetBSD: | |
| 94 set path=(${path} /usr/pkg/{bin,sbin}) | |
| 95 breaksw | |
| 96 case OpenBSD: | |
| 97 set path=(${path} /usr/local/{bin,sbin}) | |
| 98 setenv LSCOLORS ExGxFxdxCxegedabagExEx | |
| 99 test "${iscolor}" -eq 1 && setenv TERM xterm-256color | |
| 100 ( which colorls ) > /dev/null && alias ls colorls -FG | |
| 101 breaksw | |
| 102 case DragonFly: | |
| 103 set path=(${path} /usr/pkg/{bin,sbin}) | |
| 104 setenv LSCOLORS ExGxFxdxCxegedabagExEx | |
| 105 alias ls ls -FG | |
| 106 breaksw | |
| 107 case SunOS: | |
| 108 set path=(${path} /usr/{gnu,csw,xpg4}/{bin,sbin}) | |
| 109 test -x /usr/gnu/bin/ls && alias ls /usr/gnu/bin/ls ${gnuls_opts} | |
| 110 breaksw | |
| 111 case Linux: | |
| 112 alias ls ls ${gnuls_opts} | |
| 113 alias grep grep --color=auto | |
| 114 breaksw | |
| 115 endsw | |
| 116 unset gnuls_opts | |
| 117 | |
| 118 ( which vim ) > /dev/null && alias vi vim && setenv EDITOR vim | |
| 119 | |
| 120 test -f "${HOME}/.ecos_tcsh.after" && source "${HOME}/.ecos_tcsh.after" | |
| 121 | |
| 122 test -x "/usr/games/fortune" && "/usr/games/fortune" |
