forked from jeapostrophe/exp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
165 lines (134 loc) · 3.62 KB
/
.zshrc
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
source ~/.profile
setopt inc_append_history
setopt share_history
setopt auto_cd
setopt printeightbit
hash -d scm=$SVNROOT
hash -d plt=$PLTHOME
hash -d pkgs=~plt/pkgs
hash -d epkgs=~plt/extra-pkgs
hash -d ws=~epkgs/web-server
hash -d drdr=~epkgs/drdr
hash -d pkgi=~epkgs/pkg-index
hash -d work=$PROJS
hash -d papers=~work/papers
hash -d planet=~scm/github.jeapostrophe.planet
hash -d github=~scm/github.jeapostrophe
hash -d home=~github/home
hash -d gb=~github/get-bonus
hash -d lll=~github/lll
hash -d exp=~scm/github.jeapostrophe/exp
hash -d fin=~scm/github.jeapostrophe/home/finance
hash -d j=~github/home/journal
hash -d blogs=~scm/blogs
hash -d courses=~work/courses
hash -d 305=~courses/2015/fall/305
hash -d 308=~courses/2016/spring/308
hash -d 304=~courses/2016/spring/304
hash -d utrs=~scm/bitbucket.jeapostrophe/consulting-utrs
export PATH=~exp/bin:~work/papers/etc/bin:$PATH
setopt autopushd pushdminus pushdsilent pushdtohome
autoload -U zmv
bindkey -e
export PS1="%S%~%s
%# "
TPS1="%~ %# "
RECENTFILES=8
# Interaction with Emacs:
function set-eterm-dir {
echo -e "\033AnSiTu" "$LOGNAME" # $LOGNAME is more portable than using whoami.
echo -e "\033AnSiTc" "$(pwd)"
if [ $(uname) = "SunOS" ]; then
# The -f option does something else on SunOS and is not needed anyway.
hostname_options="";
else
hostname_options="-f";
fi
echo -e "\033AnSiTh" "$(hostname $hostname_options)" # Using the -f option can cause problems on some OSes.
}
# Track directory, username, and cwd for remote logons.
if [ "$TERM" = "eterm-color" ]; then
precmd () { set-eterm-dir }
elif [[ "$TERM" =~ "screen" ]] ; then
precmd () {print -Pn "\e]0;$TPS1\a\033k$TPS1\033\\"}
preexec () {print -Pn "\e]0;$TPS1 $2\a\033k$TPS1 $2\033\\"}
fi
ZDIR=~/.zdir
# Read in ZDIR
write_zdir () {
pwd >! $ZDIR
}
# Read in ZDIR
read_zdir () {
pushd "$(cat $ZDIR)"
}
chpwd () {
# Save what directory we are in for the future
write_zdir
# Show recently modified files
ls -t | head -$RECENTFILES | tr '\n' '\0' | xargs -0 ls -Gd
}
if [ $(pwd) = ${HOME} ] ; then
read_zdir
fi
# Completions
autoload -U compinit
compinit
if which compdef &>/dev/null ; then
compdef -d git
compdef -d svn
fi
compctl -g '*(/)' rmdir dircmp
compctl -g '*(-/)' cd chdir dirs pushd
#compctl -z -P '%' bg
#compctl -j -P '%' fg jobs disown
#compctl -j -P '%' + -s '`ps -x | tail +2 | cut -c1-5`' wait
# Caching
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.zsh/cache
# Adding known hosts
#local _myhosts
#if [[ -f "$HOME/.ssh/known_hosts" ]]; then
# _myhosts=( ${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*} )
# zstyle ':completion:*' hosts $_myhosts
#fi
# Ignore what's in the line
#zstyle ':completion:*:(rm|kill|diff):*' ignore-line yes
function oes() {
for i in $* ; do
oe $i
done
}
function teamtmp() {
NAME=$(date +%Y%m%d%H%M-)$(basename $1)
scp -r $1 uml:public_html/tmp/${NAME}
echo http://www.cs.uml.edu/~jmccarth/tmp/${NAME}
}
function findss() {
find . -name '*.ss' -o -name '*.scm' -o -name '*.rkt' -o -name '*.scrbl' | xargs grep -e $*
}
function sto() {
mkdir -p $(dirname $1)
touch $*
git add $*
o $*
}
function stoe() {
mkdir -p $(dirname $1)
touch $*
git add $*
oe $*
}
function racketdoclink() {
rm -f ~/.racket/doc
DEST=$(racket -e '(require setup/dirs) (displayln (path->string (find-user-doc-dir)))')
ln -s $DEST ~/.racket/doc
}
function rfc() {
cd `racket -l find-collection/run $1`
}
alias am=mathomatic
alias e="mathomatic -e --"
#racketdoclink
export REPORTTIME=10
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh