-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
120 lines (92 loc) · 2.9 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
# vi:set et sw=4 ts=4:
typeset -gU cdpath fpath mailpath path
fpath=("$HOME/.zsh.d" "$HOME/.local/share/zsh/site-functions" $fpath)
fpath=("$HOME/code/zsh/Functions/VCS_Info"
"$HOME/code/zsh/Functions/VCS_Info/Backends"
$fpath)
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]
then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
# Do not user prezto's partial-word and substring completions
zstyle -d ':completion:*' matcher-list
# Do not use approximations/corrections
zstyle -d ':completion:*:approximate:*'
zstyle ':completion:*' completer _complete _match
export VIRTUAL_ENV_DISABLE_PROMPT=1
prompt jpgrayson
zstyle ':vcs_info:*' enable git hg
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' get-unapplied true
else
autoload -Uz compinit
compinit
PROMPT=""
if [ -n "${SSH_CLIENT:-}" ]; then
PROMPT="%F{red}@%f%m:"
fi
PROMPT+="%B%4~%b %F{cyan}%(?.%#.%B%#%b)%f "
export PROMPT
setopt completeinword
setopt extendedglob
setopt histfindnodups
export HISTSIZE=1024
export SAVEHIST=1020
export WORDCHARS=${WORDCHARS//\//}
export ZLE_SPACE_SUFFIX_CHARS=$'&|'
bindkey -e
autoload -Uz edit-command-line
zle -N edit-command-line
bindkey "^X^E" edit-command-line
fi
setopt numericglobsort
if [ -n "$INSIDE_EMACS" ]; then
export EDITOR=emacsclient
else
export EDITOR=nvim
fi
export PYTHONBREAKPOINT=pudb.set_trace
export PYTHONSTARTUP=~/.pythonstartup
export VIRTUAL_ENV_DISABLE_PROMPT=1
export RIPGREP_CONFIG_PATH=~/.config/ripgrep/ripgreprc
#export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gnupg/S.gpg-agent.ssh"
export GPG_TTY=$(tty)
# source <(pip completion --zsh)
if command -v bat 1>/dev/null; then
export MANPAGER="sh -c 'col -bx | bat --language=man --style=plain --paging=always'"
unset LESS_TERMCAP_mb
unset LESS_TERMCAP_md
unset LESS_TERMCAP_me
unset LESS_TERMCAP_se
unset LESS_TERMCAP_so
unset LESS_TERMCAP_ue
unset LESS_TERMCAP_us
fi
if command -v pyenv 1>/dev/null 2>&1; then
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
eval "$(pyenv init -)"
if command -v pyenv-virtualenv-init 1>/dev/null 2>&1; then
eval "$(pyenv-virtualenv-init -)"
fi
if ! [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]
then
get-pyenv-version-name() {
psvar[9]="$(pyenv version-name)"
}
add-zsh-hook precmd get-pyenv-version-name
export PROMPT="(%9v) $PROMPT"
fi
fi
osc-133-prompt-marker() {
print -Pn "\e]133;A\e\\"
}
add-zsh-hook precmd osc-133-prompt-marker
function osc7 {
local LC_ALL=C
export LC_ALL
setopt localoptions extendedglob
input=( ${(s::)PWD} )
uri=${(j::)input/(#b)([^A-Za-z0-9_.\!~*\'\(\)-\/])/%${(l:2::0:)$(([##16]#match))}}
print -n "\e]7;file://${HOSTNAME}${uri}\e\\"
}
add-zsh-hook -Uz chpwd osc7