-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc##work.CYGWIN_NT-10.0
108 lines (90 loc) · 3.01 KB
/
.zshrc##work.CYGWIN_NT-10.0
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
########################################################
# vim:smd:ar:si:et:bg=dark:ts=4:sw=4
# file: .zshrc
# author: Chris Olin - https://www.chrisolin.com
# purpose: personal zshrc configuration
# created date: 03-18-2013
# license:
########################################################
# compinit is slow in cygwin, let's speed it up
# Speed up startup by only checking once a day
# if the cached .zcompdump file should be regenerated
# source aliases
if [ -f "${HOME}/.aliases" ]; then
source "${HOME}/.aliases"
fi
if [ -f "${HOME}/.secretaliases" ]; then
source "${HOME}/.secretaliases"
fi
# source and load antigen
if [ ! -d ~/.antigen ]; then
git clone https://github.com/zsh-users/antigen.git ~/.antigen
fi
source ~/.antigen/antigen.zsh
# antigen init
antigen init ~/.antigenrc
# apply settings
antigen apply
# set autosuggestions hotkey to ctrl+space
bindkey '^ ' autosuggest-accept
# speed up pasting, workaround from https://github.com/zsh-users/zsh-autosuggestions/issues/141
zstyle ':bracketed-paste-magic' active-widgets '.self-*'
# always load zprof for perf troubleshooting
zmodload zsh/zprof
#======= set prompt "theme" =======#
# configure prompt colors
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
eval my_gray='$FG[237]'
eval my_orange='$FG[214]'
# git color settings
ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075](branch:"
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_PROMPT_DIRTY="$my_orange*%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="$FG[075])%{$reset_color%}"
# set prompts
PROMPT='$FG[046]$(yadm_class_info) $FG[124][%y]%{$reset_color%}% $FG[032]%~ \
$(git_prompt_info) \
$FG[105]%(!.#.»)%{$reset_color%} '
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
RPS1='${return_code}'
#==================================#
# autocompletion with arrow key interface
zstyle ':completion:*' menu select
# autocompletion of command line switches for aliases
setopt completealiases
# set environment variables for gpg-agent
gpg_agent_info="${HOME}/.gnupg/gpg-agent-info"
if [ -f $gpg_agent_info ]
then
source $gpg_agent_info
export GPG_AGENT_INFO
export GPG_TTY=$(tty)
fi
# autoconfigure ssh-agent
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Starting ssh-agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
ssh-add $HOME/.ssh/id_*[!.pub];
}
# source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
#ps ${SSH_AGENT_PID} doesn't work under cywgin
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi
#other stuff
export PATH=$PATH:/usr/local/bin:$HOME/bin
export CYGWIN="mintty winsymlinks:nativeforce"
export TERM=xterm-256color
export LANG="en_US.UTF-8"
unset GREP_OPTIONS # getting rid of that godforsaken warning message about this variable being depricated every time I use grep