-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
48 lines (39 loc) · 1.17 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
export ZSH=~/.oh-my-zsh
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
ZSH_THEME="arrow"
DISABLE_UPDATE_PROMPT='true'
HIST_STAMPS="yyyy-mm-dd"
plugins=(git swiftpm docker docker-compose)
export EDITOR='nvim'
alias vi='nvim'
alias vim='nvim'
source $ZSH/oh-my-zsh.sh
if [ -f ~/.zshrc-local ]; then
source ~/.zshrc-local
fi
expand-aliases() {
unset 'functions[_expand-aliases]'
functions[_expand-aliases]=$BUFFER
(($+functions[_expand-aliases])) &&
BUFFER=${functions[_expand-aliases]#$'\t'} &&
CURSOR=$#BUFFER
}
function precmd() {
# Print a newline before the prompt, unless it's the
# first prompt in the process.
if [ -z "$NEW_LINE_BEFORE_PROMPT" ]; then
NEW_LINE_BEFORE_PROMPT=1
elif [ "$NEW_LINE_BEFORE_PROMPT" -eq 1 ]; then
echo ""
fi
}
zle -N expand-aliases
bindkey '\e^E' expand-aliases
alias gfix='git diff --name-only | uniq | while read line ; do echo \"$line\" ; done | xargs -o $EDITOR -p'
gprune() {
remote=${1-origin}
permanent_branches="main|master|develop"
git branch --merged | grep -v -E "(\*|$permanent_branches)" | xargs -n 1 git branch -d
git remote prune $remote || git remote prune `git remote`
}