-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc
83 lines (70 loc) · 2.22 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
78
79
80
81
82
83
#
# ~/.zshrc
#
export ZSH=$HOME/.dotfiles/zsh/oh-my-zsh
export ZSH_THEME="fwalch"
# For virtual console, fall back to fwalch theme included in oh-my-zsh
if [[ $TERM != "linux" ]]; then
export ZSH_CUSTOM=$HOME/.dotfiles/zsh/custom
fi
DISABLE_AUTO_UPDATE=true
source $ZSH/oh-my-zsh.sh
# Colors!
if [[ $TERM != "linux" ]]; then
eval $(dircolors -b $ZSH_CUSTOM/badwolf.dircolors)
export GREP_COLOR='01;33'
# Use LS_COLORS for completion
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
fi
bindkey -v
bindkey -M viins "^K" history-beginning-search-backward
bindkey -M viins "^J" history-beginning-search-forward
bindkey -M viins "^P" up-line-or-history
bindkey -M viins "^N" down-line-or-history
bindkey -M vicmd "^K" history-beginning-search-backward
bindkey -M vicmd "^J" history-beginning-search-forward
bindkey -M vicmd "^P" up-line-or-history
bindkey -M vicmd "^N" down-line-or-history
bindkey -M vicmd "?" history-incremental-search-backward
bindkey -M vicmd "/" history-incremental-search-forward
unsetopt correct_all
unsetopt auto_name_dirs
unsetopt inc_append_history
setopt append_history
setopt histignorespace
# Based on https://github.com/justinmk/config/blob/master/.bashrc#L222
ghrebasepr() {(
set -e
set -o pipefail
PR=${1}
REPO_SLUG="$(git config --get remote.upstream.url \
| sed 's/^.*:\/\/github.com\/\(.*\)\.git/\1/')"
PR_TITLE="$(curl -Ss "https://api.github.com/repos/${REPO_SLUG}/pulls/${PR}" \
| jq -r '.title' \
| sed 's/^\[\(RFC\|RDY\)\] *//')"
git fetch upstream &&
git checkout refs/pull/upstream/${PR} &&
git rebase upstream/master &&
git checkout master &&
git stash save autosave-$(date +%Y%m%d_%H%M%S) &&
git reset --hard upstream/master &&
git merge -m "Merge #${PR} '${PR_TITLE%.}'." \
--no-ff - &&
git log -n 15
)}
ghrebase1() {
PR=${1}
git fetch upstream &&
git checkout refs/pull/upstream/${PR} &&
git rebase upstream/master &&
git checkout master &&
git stash save autosave-$(date +%Y%m%d_%H%M%S) &&
git reset --hard upstream/master &&
git merge --ff-only - &&
git commit --amend -m "$(git log -1 --pretty=format:"%B" \
| sed -E "1 s/^(.*)\$/\\1 #${PR}/g")" &&
git log -n 15
}
if [[ -f $HOME/.zshrc.local ]]; then
source $HOME/.zshrc.local
fi