-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_zshrc
144 lines (124 loc) · 4.44 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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# source antigen and apply plugins. zsh-syntax-highlighting must be the last plugin sourced.
source ~/.zsh/antigen/antigen.zsh
antigen bundle ael-code/zsh-colored-man-pages
antigen bundle zsh-users/zsh-history-substring-search
antigen apply
# some color tweaks for zsh-syntax-highlighting
# more info at https://github.com/zsh-users/zsh-syntax-highlighting/tree/master/docs/highlighters
typeset -A ZSH_HIGHLIGHT_STYLES
ZSH_HIGHLIGHT_STYLES[alias]='fg=cyan'
ZSH_HIGHLIGHT_STYLES[command]='fg=cyan'
ZSH_HIGHLIGHT_STYLES[builtin]='fg=cyan'
# autoload built in prompt themes
autoload -Uz promptinit
promptinit
# autoload other stuff
autoload zcalc
# powerlevel9k prompt and settings
source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir newline vcs dir_writable)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=()
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
POWERLEVEL9K_CONTEXT_DEFAULT_FOREGROUND='black'
POWERLEVEL9K_CONTEXT_DEFAULT_BACKGROUND='cyan'
POWERLEVEL9K_DIR_HOME_FOREGROUND='black'
POWERLEVEL9K_DIR_HOME_BACKGROUND='blue'
POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND='black'
POWERLEVEL9K_DIR_HOME_SUBFOLDER_BACKGROUND='blue'
POWERLEVEL9K_DIR_WRITABLE_FORBIDDEN_FOREGROUND='228'
POWERLEVEL9K_DIR_WRITABLE_FORBIDDEN_BACKGROUND='green'
POWERLEVEL9K_DIR_DEFAULT_FOREGROUND='black'
POWERLEVEL9K_DIR_DEFAULT_BACKGROUND='green'
POWERLEVEL9k_DIR_ETC_FOREGROUND='black'
POWERLEVEL9k_DIR_ETC_BACKGROUND='green'
# enables autocompletion with a arrow-key driven interface
autoload -Uz compinit
compinit
zstyle ':completion:*' menu select
# for autocompletion of command line switches for aliases
setopt COMPLETE_ALIASES
# enable editor/vim mode
bindkey -v
# environment variables
export BROWSER="firefox"
export EDITOR="nvim"
export GPG_TTY=$(tty)
export TERMINAL="termite"
export PATH=~/code/istio/bin:~/.local/bin:~/bin:"$PATH"
export LEDGER_FILE=~/finance/2021.journal
export HISTFILE=~/.zsh_history
export HISTSIZE=1000000000
export SAVEHIST=${HISTSIZE}
export USE_GKE_GCLOUD_AUTH_PLUGIN=True
# import cholorscheme from 'wal' asynchronously
# & run the process in the background
# ( ) # Hide shell job control messages.
(cat $HOME/.cache/wal/sequences &)
# import wal colorscheme to ttys
source $HOME/.cache/wal/colors-tty.sh
# simplify prompt for ttys
source $HOME/bin/simpleprompt.sh
# enable dynamic titles for termite. this doesn't work the way it's supposed to. idk why.
if [[ $TERM == xterm-termite ]]; then
. /etc/profile.d/vte.sh
__vte_prompt_command
fi
# initialize nvm
#export NVM_DIR="$HOME/.nvm"
#[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
#[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
source /usr/share/nvm/init-nvm.sh
# load pkgfile command not found script
source /usr/share/doc/pkgfile/command-not-found.zsh
# aliases
alias am='alsamixer'
alias mv='mv -iv'
alias rm='rm -Iv'
alias cp='cp -iv'
alias ls='ls --color=auto'
alias l='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias spindown='udisksctl power-off -b /dev/sdc'
alias unmountphone='fusermount -u ~/mnt/Samsung\ Galaxy'
alias apbssid='nmcli -f in-use,ssid,bssid,signal,bars dev wifi'
alias weather='curl wttr.in/hoboken+new+jersey'
alias mkfat='mkfs -t vfat'
alias mkext='mkfs -t ext4'
alias srv='python -m http.server'
alias sudo='sudo '
alias left-monitor='xrandr --output VGA-1 --auto --left-of LVDS-1'
alias v='nvim'
alias gm='git merge'
alias grb='git rebase'
alias gpft='git push --follow-tags'
alias zshrc="v ~/.zshrc"
alias vimrc="v ~/.vimrc"
alias i3rc="v ~/.config/i3/config"
alias uncommit='reset HEAD~'
alias grep-ri='grep -Ri --exclude-dir=node_modules'
# Kubectl shortcuts
alias kl='kubectl logs'
alias kp='kubectl get pods'
alias ks='kubectl get services'
alias wkd='watch kubectl get deployments'
alias wkp='watch kubectl get pods'
alias wks='watch kubectl get services'
# Docker stuff
# Clear Docker cache
alias dprune='docker system prune --all'
# Keybindings
# Bind Ctrl-R to History Search
bindkey '^R' history-incremental-pattern-search-backward
# Bind Ctrl-W to Delete Word Backwards
bindkey '^W' backward-kill-word
# Bind Ctrl-K/Ctrl-J to go Up/Down in History
bindkey '^K' history-substring-search-up
bindkey '^J' history-substring-search-down
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh