/
zshrc
74 lines (59 loc) · 1.85 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
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
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
# Completions
autoload -U compinit && compinit
autoload -U +X bashcompinit && bashcompinit
if command -v terraform >/dev/null 2>&1; then
complete -o nospace -C "$(command -v terraform)" terraform
fi
### Exports ###
export EDITOR=vim
export ZSH=$HOME/.oh-my-zsh
### ZSH Config ###
ZSH_THEME="powerlevel10k/powerlevel10k"
plugins=(git zsh-autosuggestions kubectl)
source $ZSH/oh-my-zsh.sh
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# PATH
export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:/opt/homebrew/bin:/home/linuxbrew/.linuxbrew/bin:$PATH
### Aliases ###
alias k=kubectl
alias kg='kubectl get'
alias kd='kubectl describe'
alias "docker-compose"="docker compose"
alias vim=nvim # Here goes neovim!
alias e='tmux capture-pane -pS - | code - &'
alias pushup='git push -u origin HEAD'
alias ls='ls -lah'
# OS Specific
if [[ "$OSTYPE" == "darwin"* ]]; then
# Commands for macOS
alias example1='command_for_mac'
alias o="open $(pwd)"
else
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
alias open=nautilus
alias apt=dnf
alias o="/usr/bin/nautilus $(pwd)"
fi
### Functions
# Update dotfiles
function dfu() {
(
cd ~/.dotfiles && git pullff && ./install -q
)
}
# Base64 encode function
function b64enc() {
echo -n ${1} | base64
}
# Base64 decode function
function b64dec() {
echo -n ${1} | base64 -D
}