-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathzshrc
89 lines (77 loc) · 2.54 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
# Initialize starship
eval "$(starship init zsh)"
# Aliases
alias ..="cd .."
alias ga="git add"
alias gbC="git branch -C"
alias gc="git commit -v"
alias gca="git commit --amend"
alias gco="git checkout"
alias gm="git merge"
alias gp="git push"
alias gst="git status"
alias gwd="git diff"
alias gL="git pull"
alias gSa="git submodule add"
alias gSu="git submodule update --init --recursive"
alias la="ls --color=auto -l"
alias ls="ls --color=auto"
alias scp="scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
alias ssh="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
alias tmux="tmux -2"
# Path configuration
path+=("/opt/homebrew/bin")
path+=("~/.local/bin")
path+=("~/go/bin")
export PATH
# Other environment variables
export BROWSER="open"
export EDITOR="nvim"
export FZF_DEFAULT_COMMAND='ag --hidden -p ~/.agignore -g ""'
export GOPATH="~/go:/data/users/sebdah/fbsource/fbcode:/data/users/sebdah/fbsource/fbcode/third-party-go:/data/users/sebdah/fbsource/fbcode/third-party-go/vendor:/data/users/sebdah/fbsource/fbcode/third-party-source/go"
export GOPRIVATE='github.com/sebdah/devinsight,github.com/clockwork-guru/*,gitlab.com/agrea'
export GPG_TTY=$(tty)
export LANG="en_US.UTF-8"
export LANGUAGE="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export LESS='-F -g -i -M -R -S -w -X -z-4'
export PAGER="less"
export TERM="screen-256color"
export VISUAL="nvim"
# FZF configuration
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# Facebook initialization
if [[ $HOSTNAME == *"facebook.com"* ]] ; then
source /usr/facebook/ops/rc/master.zshrc
fi
# dcleanup can be used to clean up docker images.
dcleanup () {
docker rm -v $(docker ps --filter status=exited -q 2>&1 /dev/null) 2>&1 /dev/null
docker rmi $(docker images --filter dangling=true -q 2>&1 /dev/null) 2>&1 /dev/null
docker volume rm $(docker volume ls -qf dangling=true)
}
# gcleanup is cleaning local git branches that have already been merged on origin.
gcleanup () {
git branch -r --merged | grep -v master | sed 's/origin\///' | xargs -n 1 git push --delete origin
}
# tC is cleaning all tmux sessions.
tC () {
tmux list-sessions | awk 'BEGIN{FS=":"}{print $1}' | xargs -n 1 tmux kill-session -t
}
# Turn on the Facebook proxy
proxy-on () {
export HTTP_PROXY="fwdproxy:8080"
export HTTPS_PROXY="fwdproxy:8080"
}
# Turn off the Facebook proxy
proxy-off () {
unset HTTP_PROXY
unset HTTPS_PROXY
}
# Avoid dedupes in zsh history
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_FIND_NO_DUPS
setopt HIST_SAVE_NO_DUPS