comparison tcsh @ 0:cd87be0968d9

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