This repository was archived by the owner on Apr 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_zshrc
70 lines (62 loc) · 1.64 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
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
bindkey -v
CASE_SENSITIVE="true"
# End of lines configured by zsh-newuser-install
# fix ls printing unicode correctly
export LANG=en_US.UTF-8
# fix git diff printing unicode correctly
export LESSCHARSET=UTF-8
export PS1=$'%n@%m:%{\e[0;36m%}%1~%{\e[0;31m%}$ %{\e[0m%}'
export PATH="$HOME/bin:/usr/local/bin:/usr/local/sbin:$PATH"
export EDITOR="vi"
if type "vim" > /dev/null; then
alias vi="vim"
export EDITOR="vim"
fi
if type "nvim" > /dev/null; then
alias vi="nvim"
alias vim="nvim"
export EDITOR="nvim"
fi
case "$OSTYPE" in
darwin*)
export CLICOLOR=1
# also needing colorful ls in nix-shell
alias ls="ls --color=auto"
;;
linux*)
alias ls="ls --color=auto"
;;
dragonfly*|freebsd*|netbsd*|openbsd*)
;;
esac
baidu.socks() {
src_port="$[ ($RANDOM % 6 * 2 + 1) * 7 + 44300 ]"
dst_port="1337"
address="baidu.internal.lb.func.xyz"
ssh -D "${dst_port}" -p "${src_port}" -C -N "jack@${address}"
}
proxy-setup() {
addr="$1"
export http_proxy="http://${addr}"
export https_proxy="http://${addr}"
export all_proxy="socks5://${addr}"
}
sweethome() {
sudo openconnect \
--servercert 'pin-sha256:VmDsRRR4H+FoyHb96JjAYiyyuEP0TkdozFsVZqKodIY=' \
wrt-bj.lb.func.xyz:4443
}
if type "direnv" > /dev/null; then
eval "$(direnv hook zsh)"
alias tmux='direnv exec / tmux' # tricky, copied from https://direnv.net/CHANGELOG.html, 2.6.0 / 2015-02-15
fi
if [ -e /usr/local/bin/brew ]; then
eval "$(/usr/local/bin/brew shellenv)"
fi # added homebrew setup
if [ -e ~/.nix-profile/etc/profile.d/nix.sh ]; then
. ~/.nix-profile/etc/profile.d/nix.sh;
fi # added by Nix installer