5 # Turn off autocomplete beeps
8 # Search history with up and down key
9 autoload
-U history-search-end
10 zle
-N history-beginning-search-backward-end history-search-end
11 zle
-N history-beginning-search-forward-end history-search-end
12 bindkey
"\e[A" history-beginning-search-backward
13 bindkey
"\e[B" history-beginning-search-forward
15 # need zsh-completions
16 zstyle
':completion:*' rehash true
17 zstyle
':completion:*:ssh:*' hosts on
18 zstyle
':completion:*' menu
select=2
19 zstyle
':completion::complete:*' gain-privileges
1
20 zstyle
":completion:*" auto-description
"specify: %d"
21 zstyle
":completion:*:default" list-colors
${(s.:.)LS_COLORS}
22 zstyle
":completion:*" list-colors
""
24 autoload
-Uz compinit
&& compinit
25 autoload
-Uz promptinit
&& promptinit
26 autoload
-Uz colors
&& colors
28 #setopt COMPLETE_ALIASES
29 setopt completealiases
32 setopt hist_ignore_all_dups
33 setopt hist_ignore_space
37 # git plugin, require CommandLineTools or Xcode.app
38 if [ -d $
(xcode-select
-p)/usr
/share
/git-core
]; then
41 source $
(xcode-select
-p)/usr
/share
/git-core
/git-prompt.sh
42 export GIT_PS1_SHOWDIRTYSTATE
=1i
43 export GIT_PS1_SHOWSTASHSTATE
=1
44 export GIT_PS1_SHOWUNTRACKEDFILES
=1
47 git_ps1
() { command git branch
>/dev
/null
2>&1 && __git_ps1
; }
50 #export PS1='%F{7}%*%f %F{6}%m:%~%f%F{2}$(git_ps1)%f %F{6}$%f '
51 #export PS1='%F{7}%*%f %F{6}%m:%~%f%F{2}$(case $- in (*l*) git_ps1; esac)%f %F{6}$%f '
52 export PS1
='%F{7}%*%f %F{6}%m:%~%f%F{2}$([[ -o login ]] && git_ps1)%f %F{6}$%f '
56 [[ -f ~
/.bash_alias
]] && . ~
/.bash_alias
61 if hash gpg-agent
2>/dev
/null
; then
65 if hash gpgconf
2>/dev
/null
; then
67 if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$
]; then
68 export SSH_AUTH_SOCK
=$
(gpgconf
--list-dirs agent-ssh-socket
)
74 #if [[ "$(tput colors)" == 256 ]]; then
75 # hash ccal 2>/dev/null && ccal -u
79 # `ssh remote tmux` will try to attach remote's tmux session or
80 # create a new remote's tmux session.
81 # `ssh remote` do the regular connection.
83 # local _sshpath=$(which -a ssh| sed -n '$p')
84 # if [[ $@ =~ tmux ]]; then
85 # $_sshpath -C -t ${@%%tmux} "tmux attach >/dev/null 2>&1 || tmux new";