-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
162 lines (135 loc) · 4.36 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#Liferay-only. Should shell into custom image w/ installed ZSH stuff
#if [[ $TILIX_ID ]] ; then
# docker run --mount src=$(pwd),target=/mnt,type=bind -it carlossma/zsh:0.0.1
#fi
#---------- STYLE
# Colors for ls command
eval $(dircolors)
# Ignore case-sensitivity on tab completion
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
# Tab menu
zstyle ':completion:*' menu no
# todo identify specifically what each one does
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' menu select
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
bindkey '^[[Z' reverse-menu-complete
zstyle ':zle:*ward-word' word-style space
zstyle ":completion:*:default" list-colors ${(s.:.)LS_COLORS} "ma=48;5;153;1"
# fzf-tab menu
bindkey '^[[Z' reverse-menu-complete
zstyle ':zle:*ward-word' word-style space
#---------- NAVIGATION
# KEYBINDINGS
#todo identify specifically what each one does
bindkey $'\E[1;5D' emacs-backward-word
bindkey $'\E[1;5C' emacs-forward-word
bindkey '^[[Z' reverse-menu-complete
bindkey '^H' backward-kill-word
bindkey -M emacs '^[[3;5~' kill-word
bindkey '^[[H' beginning-of-line
bindkey '^[[F' end-of-line
bindkey '^[[3~' delete-char
# Enable cd by only tiping folder name
setopt autocd
# Remove $ when running output on starship
# But without ommiting the output
set +o prompt_cr +o prompt_sp
# Delete / slashes instead of entire folder path
export WORDCHARS=''
# Tilix fix. Allows new terminal sessions to be opened at the folder of previous session.
if [ $TILIX_ID ] || [ $VTE_VERSION ]; then
source /etc/profile.d/vte.sh
fi
#---------- CUSTOM FUNCTIONS
#! Create a file inside ~/.zsh_functions with the function name you want.
#! This script will load all files inside this folder.
fpath=(~/.zsh_functions $fpath)
autoload -Uz $fpath[1]/*(.:t)
#---------- HISTORY
# Share history between multiple terminal sessions
setopt INC_APPEND_HISTORY
setopt EXTENDED_HISTORY
setopt HIST_IGNORE_ALL_DUPS
export HISTFILE=~/.zsh_history
export HISTSIZE=1000
export SAVEHIST=1000
#---------- COMPLETIONS
# Gcloud
source $HOME/google-cloud-sdk/path.zsh.inc
source $HOME/google-cloud-sdk/completion.zsh.inc
# Kubectx
source ~/.zsh/kubectx-completion/
#? https://github.com/zsh-users/zsh-completions
# todo change later to antigen plugin
# source ~/.zsh/zsh-completions/src/
# Vagrant
fpath=(/opt/vagrant/embedded/gems/gems/vagrant-2.4.1/contrib/zsh $fpath)
#---------- ALIASES
#! Use ~/.aliases file to load sensitive aliases
source $HOME/.aliases
alias bcat="batcat"
alias bname="git branch | grep \* | cut -d ' ' -f 2 | tr -d '\n'"
alias c="clear"
alias cat="batcat -p"
alias copy="xclip -sel clip"
alias currentHash='git rev-parse --verify HEAD | cut -c1-8'
alias cp="/opt/advcpmv/advcp -rg"
alias d="docker"
alias dbash="d run -it --entrypoint=/bin/bash"
alias g="git"
alias history="fc -li 1"
alias k="kubectl"
alias kctx="kubectl ctx"
alias ked="kubectl edit deploy"
alias kens="kubectl ns"
alias keti="kubectl exec -ti"
alias kgp="kubectl get pods"
alias kns="kubectl get ns"
alias kpg="kubectl get pods"
alias kubectx="kubectl ctx"
alias kubens="kubectl ns"
alias lad="lazydocker"
alias ldo="lazydocker"
alias lg="lazygit"
alias ls="eza --icons --group-directories-first"
alias minidocker='eval $(minikube docker-env)'
alias mv="/opt/advcpmv/advmv -g"
alias nb="npm run build"
alias nf="npm run format"
alias nrb="npm run build"
alias nrf="npm run format"
alias nt="npm run test"
alias nt="npm run test"
alias nvm="fnm"
alias ping8="ping 8.8.8.8"
alias pingg="ping 8.8.8.8"
alias psrg="ps -ef | rg"
alias stern="k stern"
alias tf="terraform"
alias tree="eza --tree"
alias update_all="sudo apt update && sudo apt upgrade -y && flatpak update -y && sudo snap refresh"
alias watch-1="watch -n1 "
#---------- APPLICATIONS
# fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# asdf
. $HOME/.asdf/asdf.sh
fpath=(${ASDF_DIR}/completions $fpath)
# fnm
export PATH="$HOME/.local/share/fnm:$PATH"
eval "$(fnm env --use-on-cd --version-file-strategy=recursive)"
#---------- PLUGINS
source ~/.zsh/antigen.zsh
antigen bundle Aloxaf/fzf-tab
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-autosuggestions
antigen bundle zsh-users/zsh-completions
antigen apply
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
#---------- STARSHIP
eval "$(starship init zsh)"
#---------- ZOXIDE
autoload -Uz compinit && compinit -i
eval "$(zoxide init zsh)"