This repository has been archived by the owner on Nov 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.zshrc
159 lines (127 loc) · 3.44 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
#!/usr/bin/env zsh
export HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew"
export HOMEBREW_CELLAR="/home/linuxbrew/.linuxbrew/Cellar"
export HOMEBREW_REPOSITORY="/home/linuxbrew/.linuxbrew/Homebrew"
export PATH=$HOME/.pyenv/shims:$HOME/.pyenv/plugins/pyenv-virtualenv/shims:$HOME/.rbenv/shims:$HOME/.asdf/shims:/usr/bin:/usr/local/bin:/usr/local/sbin:$HOME/.bin:$HOME/.rbenv/bin:$HOME/.pyenv/bin:$HOME/.cargo/bin:$HOME/.asdf/bin:$GOPATH/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:$PATH
export MANPATH=/home/linuxbrew/.linuxbrew/share/man:$MANPATH
export INFOPATH=/home/linuxbrew/.linuxbrew/share/info:$INFOPATH
export EDITOR=subl
export ERL_AFLAGS="-kernel shell_history enabled"
export GIT_MERGE_AUTOEDIT=no
export GOPATH=$HOME/go
export GO111MODULE=on
export GOPROXY=https://proxy.golang.org
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export PYTHONIOENCODING=UTF-8
export PYTHONDONTWRITEBYTECODE=1
export GUARD_NOTIFY=false
export RUBY_CONFIGURE_OPTS=--with-jemalloc
export HISTFILE=$HOME/.zsh_history
export HISTSIZE=10000
export SAVEHIST=10000
setopt SHARE_HISTORY
source "$HOME/.zsh-z"
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
#### Completions
autoload -U compinit && compinit
zmodload zsh/complist
zstyle ':completion:*' menu select
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
#### Keybindings
bindkey '^[[3;5~' kill-word # ctrl+delete
bindkey '^H' backward-kill-word # ctrl+backspace
bindkey '^[[1;5H' beginning-of-line # ctrl+home
bindkey '^[[1;5F' end-of-line # ctrl+end
bindkey '^[[1;5C' forward-word # ctrl+right
bindkey '^[[1;5D' backward-word # ctrl+left
bindkey -M menuselect '^[[Z' reverse-menu-complete # shift+tab
#### Prompt
autoload -Uz vcs_info
function precmd() { vcs_info; }
zstyle ':vcs_info:git:*' formats '(%b) '
setopt PROMPT_SUBST
PS1='%F{green}%~%f ${vcs_info_msg_0_}%# '
#### Aliases
alias ls='ls --color=auto'
alias ll='ls -lh'
alias la='ls -A'
alias lla='ls -Alh'
alias ..='cd ..'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias tmp='mkdir /tmp/$$ ; cd /tmp/$$'
alias rmtmp='rm -rf /tmp/$$'
alias tree='tree -C'
alias pager='less -cRS'
alias dcleanup='docker system prune --all --volumes'
#### Functions
function open() {
for i in "$@"; do
xdg-open "$i"
done
}
function gtime() {
command time "$@"
}
function dri() {
docker run --rm -it "$@"
}
function clbin() {
curl -F 'clbin=<-' https://clbin.com
}
function g() {
git "$@"
}
function s() {
subl "$@"
}
function sm() {
smerge "$@"
}
function todo() {
grep \
--exclude-dir=public \
--exclude-dir=tmp \
--exclude-dir=vendor \
--exclude-dir=node_modules \
--exclude=\*.log \
--text \
--color \
-nRo 'TODO.*:.*\|FIXME.*:.*\|HACK.*:.*\|OPTIMIZE.*:.*' .
}
function winresize() {
wmctrl -r "$1" -e "0,0,0,$2,$3"
}
function xcopy() {
cat | xclip -selection clipboard
}
function xpaste() {
xclip -selection clipboard -o
}
function update() {
sudo apt update -y
sudo apt upgrade -y --allow-downgrades
sudo apt autoremove -y
brew update
brew upgrade
asdf update --head
asdf plugin-update --all
if test -d "$HOME/.rbenv/bin"; then
(
cd "$(rbenv root)" || exit
git pull
cd plugins/ruby-build || exit
git pull
)
fi
if test -d "$HOME/.pyenv/bin"; then
(
cd "$(pyenv root)" || exit
git pull
)
fi
rm -r ~/.cache/fontconfig
}
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh