-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
78 lines (62 loc) · 1.67 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
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="papercolor"
plugins=(
extract
fasd
history
tmux
zsh-completions
zsh-autosuggestions
zsh-syntax-highlighting
)
export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#9e9e9e,underline"
autoload -U compinit && compinit
source $ZSH/oh-my-zsh.sh
# https://dev.to/cassidoo/customizing-my-zsh-prompt-3417
autoload -Uz vcs_info
precmd() { vcs_info }
zstyle ':vcs_info:git:*' formats '%b '
setopt PROMPT_SUBST
git_prompt() {
BRANCH=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/*\(.*\)/\1/')
if [ ! -z $BRANCH ]; then
echo -n "%F{244}$BRANCH"
if [[ $(pwd) == *quarantine* ]]; then
echo -n " %F{red}INTERNAL"
fi
STATUS=$(git status --short 2> /dev/null)
if [ ! -z "$STATUS" ]; then
echo " %F{red}✗"
fi
fi
}
PS1='
%F{red}$HOST
%F{blue}%~$(git_prompt)
%F{244}%# %F{reset}'
# edit cli in vi mode
autoload -z edit-command-line
zle -N edit-command-line
bindkey "^V^V" edit-command-line
#source $HOME/.oh-my-zsh/custom/plugins/async/async.zsh
# history settings
export HISTSIZE=20000 # general
export SAVEHIST=20000 # logout
export HISTFILE=~/.zhistory
setopt INC_APPEND_HISTORY # append only
setopt HIST_IGNORE_DUPS # duplicate not recorded
setopt EXTENDED_HISTORY # timestamps for entries
# aliases
alias dg="/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME"
alias dgs="dg status"
alias dgc="dg commit"
alias gs="git status"
alias gc="git commit"
# some .bashrc stuff
alias la='ls -la'
alias gs='git status'
alias gc='git commit'
export HOMEBREW_NO_ANALYTICS=1 # no homebrew analytics
export GOPATH=$HOME/go
export PATH=$HOME/bin:$HOME/code/public/go/bin:$PATH:$HOME/go/bin