-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
77 lines (59 loc) · 1.62 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
# add snap to path
PATH=/snap/bin:$PATH
export PATH
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=512
SAVEHIST=16384
bindkey -e
# Completion settings
setopt globdots
autoload -Uz compinit
compinit
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
# Language seting(en_US.UTF-8)
export LANG='en_US.UTF-8'
# stop beep
setopt no_beep
setopt nolistbeep
# GOPATH
export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN
# setting for powerline-go
function powerline_precmd() {
PS1="$($GOPATH/bin/powerline-go -error $? -jobs ${${(%):%j}:-0})"
}
function install_powerline_precmd() {
for s in "${precmd_functions[@]}"; do
if [ "$s" = "powerline_precmd" ]; then
return
fi
done
precmd_functions+=(powerline_precmd)
}
if [ "$TERM" != "linux" ] && [ -f "$GOPATH/bin/powerline-go" ]; then
install_powerline_precmd
fi
# colorize the completion candidate
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
# ls coloring (github.com/sharkdp/vivid is required)
export LS_COLORS="$(vivid generate snazzy)"
alias ls='ls -a --color=auto'
alias ll='ls -lah --color=auto'
#cd -> ls
chpwd() {
ls
}
# shothand of systemctl
alias systat='systemctl status'
alias sysreload='sudo systemctl restart'
# sudo alias
alias sudos='sudo `fc -lrn -1`'
# setting GPG sign tty
export GPG_TTY=$(tty)
# remove merged git branches at the same time
alias rmgitbranch='git branch --merged | grep -v "*" >/tmp/merged-branches && vi /tmp/merged-branches && xargs git branch -d </tmp/merged-branches'
if type "fnm" > /dev/null 2>&1; then
eval "$(fnm env --use-on-cd)"
fi