# Brew Path
export BREW_PATH=/opt/homebrew
export PATH=$BREW_PATH/bin:$BREW_PATH/sbin:$PATH
fortune | cowsay -f turtle | lolcat
# GPG Path
export GPG_TTY=$TTY
# Path to your oh-my-zsh installation.
export ZSH="/Users/jseo/.oh-my-zsh"
# ZSH Theme
ZSH_THEME="lambda"
# Apply
plugins=(git kubectl kube-ps1 zsh-syntax-highlighting zsh-autosuggestions)
source $ZSH/oh-my-zsh.sh
# Kubernetes
alias h="helm"
alias k="kubectl"
# Redis
alias rscli="redis-cli"
alias rsrun="redis-server"
# RabbitMQ
alias rmq="rabbitmq-queues"
alias rmqctl="rabbitmqctl"
alias rmqrun="rabbitmq-server"
alias rmqdiag="rabbitmq-diagnostics"
alias rmqup="rabbitmq-upgrade"
# JetBrains
alias id="idea"
alias pc="pycharm"
alias gl="goland"
# File
alias w="which"
alias c="cat"
alias v="nvim"
alias vim="nvim"
alias ls="lsd -l --no-symlink"
alias lt="lsd --tree --no-symlink"
alias rm="trash"
# tmux
alias tm="tmux"
alias tmls="tmux ls"
alias tma="tmux attach"
alias tmat="tmux attach -t"
alias tmd="tmux detach"
alias tmst="tmux switch -t"
alias tmks="tmux kill-session -t"
alias tmksa="tmux kill-server"
# cd
alias cdr="cd /Users/jseo/Library/Mobile\ Documents/com~apple~CloudDocs/Repository"
alias cdd="cd /Users/jseo/Desktop"
alias 42c="cd /Users/jseo/Library/Mobile\ Documents/com~apple~CloudDocs/Repository/42/42-cursus"
alias tie="cd /Users/jseo/Library/Mobile\ Documents/com~apple~CloudDocs/Repository/TIE"
alias leet="cd /Users/jseo/Library/Mobile\ Documents/com~apple~CloudDocs/Repository/leetcode && code ."
alias boj="cd /Users/jseo/Library/Mobile\ Documents/com~apple~CloudDocs/Repository/boj && code ."
# git
alias gclone="git clone"
alias gadd="git add"
alias gcommit="git commit -m"
alias gpull="git pull origin"
alias gpush="git push origin"
alias gpullm="git pull origin main"
alias gpushm="git push origin main"
alias gpushmf="git push origin main --force"
alias gbranch="git branch"
alias gremote="git remote"
alias gcheck="git checkout"
alias gmerge="git merge"
alias gcache="git rm -r --cached ."
alias gcancel="git reset HEAD^"
alias glog="git log"
# c & cpp
alias gco="gcc -Wall -Werror -Wextra -o test"
alias cco="clang++ -Wall -Werror -Wextra -std=c++17 -o test"
alias cpl="cpplint"
# go
alias gmi="go mod init"
alias gmt="go mod tidy"
alias gba="go build"
alias gbo="go build -o test"
alias gci="golangci-lint run"
alias gft="gofmt -l ."
alias gnorm="golangci-lint run && gofmt -l ."
alias gclean="go clean"
alias gtest="go test"
# kubectl
alias ms="minikube start"
alias md="minikube delete"
alias kcf="kubectl craete -f"
alias kdf="kubectl delete -f"
alias kgp="kubectl get po -A"
alias kgs="kubectl get services"
alias kge="kubectl get event"
# docker
alias dbase="docker run -i -t --rm --privileged --pid=host justincormack/nsenter1"
alias dlogin="docker login"
alias dlogout="docker logout"
alias dversion="docker -v"
alias dps="docker ps"
alias dpsa="docker ps -a"
alias dpsaq="docker ps -a -q"
alias dimages="docker images"
alias dimagesd="docker images -f dangling=true"
alias dsearch="docker search"
alias dcommit="docker commit -m"
alias dpush="docker push"
alias dhistory="docker history"
alias dexport="docker export"
alias dimport="docker import"
alias dtag="docker tag"
alias dncreate="docker network create"
alias dnls="docker network ls"
alias dnconnect="docker network connect"
alias dndisconnect="docker network disconnect"
alias dninspect="docker network inspect"
alias dnrm="docker network rm"
alias dnprune="docker network prune"
alias dcattach="docker container attach"
alias dccreate="docker container create"
alias dcexec="docker container exec"
alias dcinspect="docker container inspect"
alias dcrename="docker container rename"
alias dcrm="docker container rm"
alias dcrmf="docker container rm -f"
alias dcrmfaq="docker container rm -f \$(docker ps -a -q)"
alias dcrunit="docker container run -i -t"
alias dcrund="docker container run -d"
alias dcrundit="docker run -d -i -t"
alias dcstart="docker container start"
alias dcstop="docker container stop"
alias dcprune="docker container prune"
alias dcport="docker container port"
alias dclogs="docker container logs"
alias dcupdate="docker container update"
alias dvcreate="docker volume create"
alias dvinspect="docker volume inspect"
alias dvls="docker volume ls"
alias dvprune="docker volume prune"
alias dvrm="docker volume rm"
alias dvrmf="docker volume rm -f"
alias dipull="docker image pull"
alias dirm="docker image rm"
alias dirmf="docker image rm -f"
alias diprune="docker image prune"
alias disave="docker image save"
alias diload="docker image load -i"
alias diinspect="docker image inspect"
alias dbt="docker build -t"
alias dbprune="docker builder prune"
# Terminal & Vim settings
alias oz="open ~/.zshrc"
alias sz="source ~/.zshrc"
alias vz="nvim ~/.zshrc"
alias cz="cat ~/.zshrc"
alias ov="open ~/.config/nvim/init.vim"
alias vv="nvim ~/.config/nvim/init.vim"
alias cv="cat ~/.config/nvim/init.vim"
alias ot="open ~/.tmux.conf"
alias vt="nvim ~/.tmux.conf"
alias ct="cat ~/.tmux.conf"
# Port Process Number
alias ppn="lsof -i"
# Kill Process
alias kp="kill -9"
# Prompt
build_prompt() {
RETVAL=$?
prompt_status
prompt_virtualenv
prompt_context
prompt_dir
prompt_git
prompt_bzr
prompt_hg
prompt_newline
prompt_end
}
prompt_newline() {
if [[ -n $CURRENT_BG ]]; then
echo -n "%{%k%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR
%(?.%F{$CURRENT_BG}.%F{red})❯%f"
else
echo -n "%{%k%}"
fi
echo -n "%{%f%}"
CURRENT_BG=''
}
prompt_context() {
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
prompt_segment black default "%(!.%{%F{yellow}%}.)$USER"
fi
}
[[ $commands[kubectl] ]] && source <(kubectl completion zsh)
Shell
복사