-
Notifications
You must be signed in to change notification settings - Fork 2
/
.zshrc.mac
73 lines (60 loc) · 1.61 KB
/
.zshrc.mac
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
function git {
if [ -f /usr/local/lib/opensc-pkcs11.so ]; then
if ! ssh-add -L | grep -q opensc; then
ssh-add -s /usr/local/lib/opensc-pkcs11.so
fi
fi
/usr/bin/git "$@"
}
function ssh {
if [ -f /usr/local/lib/opensc-pkcs11.so ]; then
if ! ssh-add -L | grep -q opensc; then
ssh-add -s /usr/local/lib/opensc-pkcs11.so
fi
fi
/usr/bin/ssh "$@"
}
# Change vi mode cursor shape in iTerm
function zle-set-cursor-shape {
case $KEYMAP in
vicmd) print -n -- "\E]50;CursorShape=0\C-G" ;;
viins|main) print -n -- "\E]50;CursorShape=1\C-G" ;;
esac
zle reset-prompt
zle -R
}
function zle-line-init {
if (( $+terminfo[smkx] )); then
echoti smkx
fi
zle editor-info
# Set cursor based on mode
zle-set-cursor-shape
}
function zle-keymap-select {
zle editor-info
# Set cursor based on mode
zle-set-cursor-shape
}
function zle-line-finish {
if (( $+terminfo[rmkx] )); then
echoti rmkx
fi
zle editor-info
# Reset to block cursor
print -n -- "\E]50;CursorShape=0\C-G"
}
zle -N zle-line-init
zle -N zle-line-finish
zle -N zle-keymap-select
function cdd {
FZF_DEFAULT_COMMAND_SAVED=$FZF_DEFAULT_COMMAND
export FZF_DEFAULT_COMMAND="find $HOME/Development -type d -mindepth 1 -maxdepth 6 -not -path '*/\.*' -and -not -path '*/go/pkg*' | sed 's_${HOME}/Development[/]__g'"
cd $HOME/Development/$(fzf)
export FZF_DEFAULT_COMMAND=$FZF_DEFAULT_COMMAND_SAVED
}
eval $(/usr/local/bin/gdircolors)
alias ls='gls --color=auto'
export GOPATH=$HOME/Development/go
export PATH=/usr/local/bin:/usr/local/go/bin:/usr/local/sbin:$GOPATH/bin:$PATH
export GPG_TTY=$(tty)