forked from tony/.dot-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
108 lines (83 loc) · 3.02 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
source ~/.dot-config/antigen.zsh
# tmux / tmuxp
export DISABLE_AUTO_TITLE='true'
# https://github.com/robbyrussell/oh-my-zsh/issues/5874
export ZSH_CACHE_DIR=$HOME/.zsh
# additional completions
autoload -U +X compinit && compinit
# ignore hosts completion
zstyle ':completion:*' hosts off
##
## History
###
### Source: https://dustri.org/b/my-zsh-configuration.html
### Also https://github.com/robbyrussell/oh-my-zsh/blob/master/lib/history.zsh
HISTFILE=~/.zsh_history # where to store zsh config
HISTSIZE=10000 # big history
SAVEHIST=10000 # big history
setopt append_history # append
setopt hist_expire_dups_first
setopt hist_ignore_all_dups # no duplicate
setopt hist_ignore_space # ignore space prefixed commands
setopt hist_verify # show before executing history commands
setopt inc_append_history # add commands as they are typed, don't wait until shell exit
setopt share_history # share hist between sessions
# antigen
antigen use oh-my-zsh
antigen bundle history
antigen bundle git
antigen bundle mafredri/zsh-async
antigen bundle sindresorhus/pure
antigen bundle lukechilds/zsh-nvm
antigen bundle chrissicool/zsh-256color
antigen bundle zsh-users/zsh-syntax-highlighting
# Enable completion caching
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.zsh/cache
# Disable hostname completion, because it's slow
zstyle ':completion:*' hosts off
if command -v reattach-to-user-namespace > /dev/null; then
alias vim="reattach-to-user-namespace vim"
alias nvim="reattach-to-user-namespace nvim"
fi
alias clear_pyc='find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf'
# for OS X keychain(1) error, Error: Problem adding; giving up
# if ! fuser "$SSH_AUTH_SOCK" >/dev/null 2>/dev/null; then
# # Nothing has the socket open, it means the agent isn't running
# ssh-agent -a "$SSH_AUTH_SOCK" -s >~/.ssh/agent-info
# fi
fixssh() {
for key in SSH_AUTH_SOCK SSH_CONNECTION SSH_CLIENT; do
if (tmux show-environment | grep "^${key}" > /dev/null); then
value=`tmux show-environment | grep "^${key}" | sed -e "s/^[A-Z_]*=//"`
export ${key}="${value}"
fi
done
}
source ~/.dot-config/.shell/env.d/ssh-agent.sh
source ~/.dot-config/.shell/env.d/keychain.sh
fixssh()
source ~/.dot-config/.shell/env.d/most.sh
source ~/.dot-config/.shell/env.d/python-breakpoint.sh
source ~/.dot-config/.shell/aliases.sh
pathprepend() {
for ARG in "$@"
do
if [ -d "$ARG" ] && [[ ":$PATH:" != *":$ARG:"* ]]; then
PATH="$ARG${PATH:+":$PATH"}"
fi
done
}
source ~/.dot-config/.shell/paths.d/python.sh
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export FZF_DEFAULT_COMMAND='
(git ls-files --recurse-submodules ||
find . -path "*/\.*" -prune -o -type f -print -o -type l -print |
sed s/^..//) 2> /dev/null'
[ -f ~/.zshrc.local ] && source ~/.zshrc.local
[ -f ~/.profile ] && source ~/.profile
antigen apply
grepp() {
history | grep $1 | sed 's/^[ ]*[0-9]*[ ]*//g' | sed 's/\\n/\
/g'
}