-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
46 lines (34 loc) · 1016 Bytes
/
.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
export EDITOR="vim"
export PATH="${HOME}/bin:/usr/local/bin:/usr/local/sbin:${PATH}"
export ZSH="${HOME}/.oh-my-zsh"
ZSH_THEME="dracula"
TERM=xterm-256color
skip_global_compinit=1
source "${ZSH}/oh-my-zsh.sh"
# Set pager
export PAGER=less
# Search history with up / down keys
bindkey "^[[A" up-line-or-search
bindkey "^[[B" down-line-or-search
# Pyenv
export PYENV_ROOT="${HOME}/.pyenv"
command -v pyenv >/dev/null || export PATH="${PYENV_ROOT}/bin:${PATH}"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
if [ $(uname -s) = "Darwin" ] && is-at-least 12.5 $(sw_vers -productVersion); then
ln -sf /usr/local/bin/python3 /usr/local/bin/python
fi
# Aliases
alias rgf="rg --files | rg"
function drm {
docker rm $(docker ps -aq)
}
function rgr {
rg "${1}" --files-with-matches -0 | xargs -0 sed -i '' "s/${1}/${2}/g"
}
function rgfr {
find . | rg "${1}" -0 | while read SRC_FILE; do
DEST_FILE=$(echo $SRC_FILE | sed "s/${1}/${2}/g")
mv $SRC_FILE $DEST_FILE
done
}