annotate tcsh @ 0:cd87be0968d9

Initial import.
author Edho Prima Arief <me@myconan.net>
date Sat, 10 Jul 2010 11:57:25 +0000
parents
children 1c563df145fa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
1 #!/usr/bin/env tcsh
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
2 umask 22
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
3 limit coredumpsize 0
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
4
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
5 set prompt="[%B%n@%m %~%b]%# "
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
6 set path=({,/usr}/{bin,sbin} "${HOME}/bin")
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
7 set history=1000
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
8 set savehist=1000
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
9 set nobeep
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
10 set filec
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
11
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
12 setenv EDITOR vi
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
13 setenv PAGER less
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
14 setenv BLOCKSIZE K
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
15 setenv LC_COLLATE C
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
16 setenv LANG en_US.UTF-8
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
17
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
18 unset autologout
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
19 unset autoexpand
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
20 unset autolist
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
21 unset ignoreeof
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
22
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
23 unalias \*
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
24 alias h history 25
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
25 alias j jobs -l
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
26 alias la ls -A
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
27 alias ll ls -lA
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
28 alias ls ls -F
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
29 alias upload-tcsh-init 'echo "put ${HOME}/.tcsh_init www/static/tcsh_init.txt" | sftp myconnet@myconan.net'
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
30 alias download-tcsh-init 'printf "%s" "Current version will be overwritten! Press enter to continue or ctrl-c to cancel."; read _ ; curl -o ${HOME}/.tcsh_init.new http://static.myconan.net/tcsh_init.txt && cp "${HOME}/.tcsh_init" "${HOME}/.tcsh_init.old" && ln -f "${HOME}/.tcsh_init.new" "${HOME}/.tcsh_init" && rm "${HOME}/.tcsh_init.old" "${HOME}/.tcsh_init.new"'
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
31
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
32 if ($?prompt) then
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
33 set gnuls_opts="--color=auto --group-directories-first -F"
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
34 set iscolor=0
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
35 switch (${TERM})
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
36 case xterm*:
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
37 case dtterm:
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
38 case screen*:
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
39 setenv CLICOLOR
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
40 set myhost=`hostname | cut -d '.' -f 1`
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
41 set prompt="[%{\033[0;33m%}%n%{\033[0m%}@%{\033[0;32m%}%m%{\033[0m%} %{\033[1;34m%}%c%{\033[0m%}]%# "
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
42 alias mypwd 'printf "%s\n" "${PWD}" | sed -e "s#^${HOME}#~#"'
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
43 alias precmd 'printf "\033]0;${USER}@${myhost}: %s\007" "`mypwd`"'
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
44 set iscolor=1
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
45 breaksw
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
46 endsw
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
47
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
48 if ("$TERM" == "screen") then
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
49 bindkey '\e[1~' beginning-of-line
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
50 bindkey '\e[3~' delete-char
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
51 bindkey '\e[4~' end-of-line
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
52 bindkey '\e[5~' history-search-backward
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
53 bindkey '\e[6~' history-search-forward
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
54 bindkey '\eOD' backward-word
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
55 bindkey '\eOC' forward-word
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
56 bindkey '\e\e[D' backward-word
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
57 bindkey '\e\e[C' forward-word
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
58 endif
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
59 bindkey "^W" backward-delete-word
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
60 bindkey -k up history-search-backward
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
61 bindkey -k down history-search-forward
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
62 endif
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
63
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
64 switch (`uname -s`)
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
65 case FreeBSD:
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
66 set path=(${path} /usr/local/{bin,sbin})
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
67 setenv LSCOLORS ExGxFxdxCxegedabagExEx
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
68 alias ls ls -FG
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
69 ( which gnuls ) > /dev/null && alias ls gnuls ${gnuls_opts}
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
70 alias man man -o
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
71 breaksw
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
72 case NetBSD:
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
73 set path=(${path} /usr/pkg/{bin,sbin})
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
74 breaksw
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
75 case OpenBSD:
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
76 set path=(${path} /usr/local/{bin,sbin})
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
77 [ "${iscolor}" -eq 1 ] && setenv TERM xterm-256color
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
78 breaksw
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
79 case DragonFly:
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
80 set path=(${path} /usr/pkg/{bin,sbin})
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
81 setenv LSCOLORS ExGxFxdxCxegedabagExEx
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
82 alias ls ls -FG
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
83 breaksw
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
84 case SunOS:
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
85 set path=(${path} /usr/{gnu,csw,xpg4}/{bin,sbin})
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
86 [ -x /usr/gnu/bin/ls ] && alias ls /usr/gnu/bin/ls ${gnuls_opts}
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
87 breaksw
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
88 case Linux:
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
89 alias ls ls ${gnuls_opts}
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
90 alias grep grep --color=auto
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
91 breaksw
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
92 endsw
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
93 unset gnuls_opts
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
94
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
95 ( which vim ) > /dev/null && alias vi vim
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
96
cd87be0968d9 Initial import.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
97 [ -e "${HOME}/.tcsh_exec" ] && source "${HOME}/.tcsh_exec"