-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathglobal.cshrc
228 lines (195 loc) · 8.36 KB
/
global.cshrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
#----------------------------------------------------------------------
#
# File for stuff that can be used on other machines without changes
# See local.cshrc
#----------------------------------------------------------------------
setenv PATH "$HOME/config/bin:$HOME/config/binpy:${PATH}"
setenv PATH "/usr/local/bin:${PATH}"
###
## Basics
#
# I like prompt simple and consistent on all machines
set prompt = "`hostname -s` \!: "
# Control permissions:
umask 002
# Useful csh feature
limit coredumpsize 1M
###
## This causes problems when using other peoples terminals
#
set color
# Good for dark backgrounds:
setenv LS_COLORS \
"di=33;1:fi=37;1:ln=36;1:ex=01;31:pi=40;33:so=01;34:bd=40;33;01:cd=4;33;01:*.o=37:*.mod=37:*.log=37:*.aux=37:*.toc=37:*.lof=37:*.lot=37:*.tpt=37"
# Good for light backgrounds:
#setenv LS_COLORS "ex=01;31:ln=31:fi=31:di=01;34:pi=40;33:so=01;34:bd=40;33;01:cd=4;33;01:*.tar=04;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.dvi=04;35:*.ps=04;34:*.eps=04;34:*.tex=01;32"
#
###
## Environment variables
#
setenv NAME "Scott Kruger"
setenv EDITOR vim
setenv MAIL_ADDRESS [email protected]
setenv NOTMUCH_CONFIG $HOME/.mutt/notmuchrc
###
## Basic coding stuff
#
alias tmpdir "cd $SCRATCH"
###
## Edit these configuration files and then source them
#
alias editcs 'vi $HOME/.tcshrc; source $HOME/.tcshrc'
alias editcg 'vi $HOME/config/global.cshrc $HOME/config/aliases.cshrc $HOME/config/mac.cshrc $HOME/config/aliases.bash; source $HOME/config/global.cshrc; source $HOME/config/aliases.cshrc; source $HOME/config/mac.cshrc'
#
###
## Quick help
#
alias tips $EDITOR $HOME/config/tips
###
## Moving around
#
set cdpath=(~ $cdpath)
#----------------------------------------------------------------------
###
## Typical tcsh variables
#
set savehist=25 # save commands (in ~/.history) b/t sessions
set history=200 # Save history of commands
set rmstar # safety precaution for rm *
unset autologout # Don't like autologout
#----------------------------------------------------------------------
bindkey "^p" history-search-backward
bindkey "^n" history-search-backward
###----------------------------------------------------------------------
###
## Rest of file is due for completion
#
set autolist # List the possible choices when TAB complete
set autolist=ambiguous # Show listing of what can be matched if multiple
set filec # Set file completion
set correct=cmd # for mispelled command
set fignore=(.log .aux .o .mod .bbl .tpt .lo) # for file completion
# Questionably useful
# set complete=enhance
# Only complete if special type of
# file/command
complete cd 'p/1/d/'
complete alias 'p/1/a/' # only aliases are valid
complete unalias 'n/1/a/'
complete man 'p/*/c/'
complete which 'n/*/c/'
complete where 'n/*/c/'
complete set 'c/*=/f/' 'p/1/s/=' 'n/=/f/'
complete unset 'n/*/s/'
complete cprundir 'p/1/d/'
# Complete if ends w/ extension
complete pre 'n/*/f:*.dat/'
complete latex 'n/*/f:*.{tex,dtx}/'
complete pdflatex 'n/*/f:*.{tex,dtx}/'
complete acroread 'n/*/f:*.pdf/'
complete dvips 'n/*/f:*.dvi/'
complete xdvi 'n/*/f:*.dvi/'
complete kdvi 'n/*/f:*.dvi/'
complete ghostview 'n/*/f:*.{ps,pdf,eps}/'
complete kghostview 'n/*/f:*.{ps,pdf,eps}/'
complete gv 'n/*/f:*{ps,pdf}/'
complete gunzip 'n/*/f:*.*gz/'
complete untar 'n/*/f:*.tar/'
complete h5dump 'n/*/f:*.h5/'
complete h5ls 'n/*/f:*.h5/'
complete h5lr 'n/*/f:*.h5/'
complete h5la 'n/*/f:*.h5/'
complete h5diff 'n/*/f:*.h5/'
# Don't complete if ends w/ extension
complete rm 'p/*/f:^*.{c,h,cc,C,tex,f,f90,F90,F}/'
complete vi 'n/*/f:^*.{aux,log,dvi,ps,bak,o,sty,toc,lof,lot,plt,mod,lyx,bbl,blg,tpt,pyc}/'
complete gvi 'n/*/f:^*.{aux,log,dvi,ps,bak,o,sty,toc,lof,lot,plt,mod,lyx,bbl,blg,tpt,pyc}/'
# Networking completion
# Automatically setup hosts.
set hosts=(volt.txcorp.com dipole.txcorp.com enrico.txcorp.com multipole.txcorp.com fusion.txcorp.com nimrod.txcorp.com iter.txcorp.com oxygen.txcorp.com qalion.txcorp.com qasnowleopard.txcorp.com qaubuntu.txcorp.com sandybridge.txcorp.com ivy.txcorp.com haswell.txcorp.com plasma.txcorp.com phi.txcorp.com ptsolvemac.txcorp.com [email protected] [email protected] [email protected] [email protected] [email protected] [email protected])
set noglob
if ( ! $?hosts ) set hosts
set hosts=($hosts)
# Hosts where I have a different login name:
set hosts=($hosts [email protected] [email protected] hydra.gat.com [email protected] jaguar.ccs.ornl.gov [email protected])
# Complete on hosts
complete ftp 'p/1/$hosts/'
complete ywho 'n/*/$hosts/'
complete rsh p/1/\$hosts/ c/-/"(l n)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
complete ssh p/1/\$hosts/ c/-/"(l n)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
complete rlogin p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/
complete telnet p/1/\$hosts/ p/2/x:'<port>'/ n/*/n/
complete scp "c,*:/,F:/," "c,*:,F:$HOME," 'n/*/$hosts/:/'
complete cvs p/1/"(add admin annotate checkout commit diff \
edit editors export history import init \
log login rdiff release remove rtag \
status tag unedit update watch)"/
complete svn p/1/"(add rm remove mv move cat co checkout commit diff \
edit editors export history import init \
log login rdiff release \
status tag unedit update watch)"/
complete hg p/1/"(add rm remove mv move cat co checkout commit diff \
edit editors export history import init \
log login release annotate serve clone pull \
status tag unedit update)"/
unset noglob
# Other useful way of automatically getting hosts:
# foreach f (/etc/hosts)
# if ( -r $f ) then
# set hosts = ($hosts `grep ^"[1-9]" /etc/hosts | tr -s " " " " | cut -f2 -d " " `)
# endif
# end
# I've tried many scp versions:
# complete scp 'n/*/f/' 'p/*/$hosts/'
# this one is simple...
#complete scp 'c/*:/f/' 'C@[./\$~]*@f@ n/*/\$hosts/:'
# From Michael Schroeder <[email protected]>
# This one will rsh to the file to fetch the list of files!
# complete rcp 'c%*@*:%`set q=$:-0;set q="$q:s/@/ /";set q="$q:s/:/ /";set q=($q " ");rsh $q[2] -l $q[1] ls -dp $q[3]\*`%' 'c%*:%`set q=$:-0;set q="$q:s/:/ /";set q=($q " ");rsh $q[1] ls -dp $q[2]\*`%' 'c%*@%$hosts%:' 'C@[./$~]*@f@' 'n/*/$hosts/:'
#complete scp "c,*:/,F:/," "c,*:,F:$HOME," 'c/*@/$hosts/:/'
#complete scp 'p/*/$hosts/' 'p/*/f/'
#complete scp 'c/*:/f/' 'n/*/\$hosts/:'
#
#curl -O http://paginas.terra.com.br/servicos/lstec/mdig/imagens/[1955-2006][01-12].jpg
###
## Common machines
#
alias noether ssh [email protected]
alias sandia ssh [email protected]
alias dipole ssh [email protected]
alias fusion ssh [email protected]
alias hydra ssh hydra.gat.com
alias franklin ssh [email protected]
alias carver ssh [email protected]
alias hopper ssh [email protected]
alias bassi ssh [email protected]
alias davinci ssh [email protected]
alias volt ssh volt.txcorp.com
alias dipole ssh dipole.txcorp.com
alias multipole ssh multipole.txcorp.com
alias enrico ssh enrico.txcorp.com
alias iter ssh iter.txcorp.com
alias sandybridge ssh sandybridge.txcorp.com
alias sb ssh sandybridge.txcorp.com
alias hip ssh hip.txcorp.com
alias ascent [email protected]
alias vsb ssh -t dipole.txcorp.com ssh -A -t sandybridge.txcorp.com
alias vivy ssh -t dipole.txcorp.com ssh -A -t ivy.txcorp.com
alias vphi ssh -t dipole.txcorp.com ssh -A -t phi.txcorp.com
alias vhip ssh -t dipole.txcorp.com ssh -A -t hip.txcorp.com
alias cybele ssh -p 2039 [email protected]
alias voxy ssh -t dipole.txcorp.com ssh -A -t oxygen.txcorp.com
alias vhaswell ssh -t dipole.txcorp.com ssh -A -t haswell.txcorp.com
alias ivy ssh ivy.txcorp.com
alias phi ssh phi.txcorp.com
alias ptmac ssh ptsolvemac.txcorp.com
alias haswell ssh haswell.txcorp.com
alias plasma ssh plasma.txcorp.com
alias qalion ssh qalion.txcorp.com
alias qasnowleopard ssh qasnowleopard.txcorp.com
alias qaubuntu ssh qaubuntu.txcorp.com
alias oxygen ssh oxygen.txcorp.com
alias tatanka ssh [email protected]
alias loki ssh -X -t cmodws29.psfc.mit.edu ssh loki.psfc.mit.edu
alias mcs ssh [email protected]
alias tulip ssh [email protected]