-
Notifications
You must be signed in to change notification settings - Fork 0
/
executable_dot_zshrc.tmpl
127 lines (105 loc) · 3.13 KB
/
executable_dot_zshrc.tmpl
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#Load Powerlevel10k
source ~/powerlevel10k/powerlevel10k.zsh-theme
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
export PATH="$HOME/bin:/usr/local/bin:$PATH"
#ZSH Plugins
#zsh-users/zsh-syntax-highlighting
source ~/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh
#MichaelAquilina/zsh-autoswitch-virtualenv
alias python=python3
source ~/zsh-autoswitch-virtualenv/autoswitch_virtualenv.plugin.zsh
export LANG="en_US.UTF-8"
# aliases and functions
# Use per machine aliases for things I dont want in git
if [ -e ~/.localalias ];then
source ~/.localalias
fi
# Share history between sessions
setopt share_history
# Tmux
alias tmove="tmux detach && tmux attach"
alias tma="tmux attach-session -t"
alias tnew="tmux new-session -d -s $1"
{{ if lookPath "vagrant" }}
# Vagrant
alias vd="vagramt destroy"
alias vg="vagrant global-status"
alias vh="vagrant halt $1"
alias vr="vagrant ssh $1 -c 'sudo su -'"
alias vs="vagrant status"
alias vssh="vagrant ssh $1"
alias vu="vagrant up $1"
{{ end }}
#GOLANG Stuff
export GOPATH=$HOME/workspace/go
export PATH=$GOPATH/bin:$PATH
#Git Alias
alias gps="git push -u"
alias gpl="git pull"
alias gco="git checkout"
alias gprune="git remote prune origin"
alias uncommit="reset --soft HEAD^"
alias unstage="reset"
alias staged="diff --cached"
cdt() {
cd `git rev-parse --show-toplevel`
}
{{ if lookPath "gh" }}
alias gpr="gh pr create"
alias gpl="gh repo sync"
alias gci="gh pr checks"
{{ end }}
unset GREP_OPTIONS
alias grep="grep --color=auto --exclude-dir=.cvs --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn"
{{ if lookPath "nvim" }}
alias vim="nvim"
export EDITOR=nvim
{{ end }}
#Fix tab completion weirdness
export LC_ALL=en_US.UTF-8
export TERM=xterm-256color
#Add fuzzy finder support
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# Silly Weather Function
weather() {
curl http://v2.wttr.in/$1
}
# OpenSSL Aliases for stuff I forget all the time and have to look up
s_client() {
openssl s_client -connect ${1}:443
}
view_cert() {
openssl x509 -in $1 -noout -text
}
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# Case-insensitive autocomplete
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
setopt no_list_ambiguous
fpath+=~/.zfunc
autoload -Uz compinit && compinit
# Bookmarks
# https://threkk.medium.com/how-to-use-bookmarks-in-bash-zsh-6b8074e40774
if [ ! -d "$HOME/.bookmarks" ]; then
mkdir ~/.bookmarks
fi
export CDPATH=".:$HOME/.bookmarks:/"
alias goto="cd -P"
bookmark() {
ln -s `pwd` ~/.bookmarks/@$1
}
bindkey -e
{{ if eq .chezmoi.os "darwin" }}
alias clip="pbcopy"
alias sshKeyUnlock="eval `ssh-agent -s` ; ssh-add -K"
# Use homebrew curl
export PATH="/usr/local/opt/curl/bin:$PATH"
eval `/opt/homebrew/bin/brew shellenv`
{{ else if eq .chezmoi.os "linux" }}
alias clip="xclip -i -selection clipboard"
alias sshKeyUnlock="eval `ssh-agent -s` ; ssh-add"
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
{{ end }}