-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc
59 lines (51 loc) · 1.53 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
# vim:set filetype=zsh nospell :
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
[[ "$-" =~ i ]] || return
[ -n "${SHOW_SOURCE:-}" ] && echo "=====start scriptting $0===="
# loadng this file is disabled by default
# with unsetopt global_rcs
#source /etc/zshrc
ZSH_RC_DIR=$(dirname $0)/zsh
bindkey -e
autoload -Uz colors
colors
# set words delimitter
autoload -Uz select-word-style
select-word-style default
zstyle ':zle:*' word-chars " /=;@:{},|"
zstyle ':zle:*' word-style unspecified
setopt print_eight_bit
setopt no_beep
setopt no_flow_control
setopt ignore_eof
setopt interactive_comments
setopt auto_cd
setopt auto_pushd
setopt noclobber #履歴が何故か変更されて>|になる
[[ "$(locale LC_CTYPE)" == "UTF-8" ]] && setopt COMBINING_CHARS
source ${ZSH_RC_DIR}/prompt.zsh
source ${ZSH_RC_DIR}/plugin.zsh
source ${ZSH_RC_DIR}/completion.zsh
source ${ZSH_RC_DIR}/alias.zsh
source ${ZSH_RC_DIR}/history.zsh
USE_AGENT=true
agent="$HOME/.ssh/agent"
if [ -S $agent ]; then
export SSH_AUTH_SOCK=$agent
elif [ -S "$SSH_AUTH_SOCK" ]; then
if [[ $SSH_AUTH_SOCK =~ /tmp/.*/agent.[0-9]* ]] then
# reuse existing agent
elif [[ $SSH_AUTH_SOCK = ${XDG_RUNTIME_DIR}* ]] then
if [[ $USE_AGENT = true ]];then
eval $(ssh-agent)
fi
fi
echo "ssh auth sock:" $SSH_AUTH_SOCK
ln -snf "$SSH_AUTH_SOCK" $agent && export SSH_AUTH_SOCK=$agent
else
echo "no ssh-agent"
eval $(ssh-agent)
ln -snf "$SSH_AUTH_SOCK" $agent && export SSH_AUTH_SOCK=$agent
fi
[ -n "${SHOW_SOURCE:-}" ] && echo "====finish scriptting $0===="