Last active
January 24, 2025 06:57
-
-
Save batako/460dc10096c6553745b96a5eca770e62 to your computer and use it in GitHub Desktop.
@.zshrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ------------------------------ | |
| # 定数定義 | |
| # ------------------------------ | |
| # Zsh | |
| export ZSH="$HOME/.oh-my-zsh" | |
| export ZSH_THEME="robbyrussell" | |
| # export RPROMPT="%m" | |
| # export ZSH_THEME="agnoster" | |
| # Oh My Zsh | |
| export ZSH=~/.oh-my-zsh | |
| export PATH="/usr/local/sbin:$PATH" | |
| # Homebrew | |
| # アップグレード時に過去のバージョンを削除 | |
| export HOMEBREW_INSTALL_CLEANUP=1 | |
| # brew の curl を使用するように | |
| export HOMEBREW_FORCE_BREWED_CURL=1 | |
| # `=brew doctor` で表示された警告対応 | |
| export PATH="/opt/homebrew/sbin:$PATH" | |
| # Docker | |
| export DOCKER_BUILDKIT=1 | |
| # postgresql-devel | |
| # =brew install libpq | |
| export PATH="/opt/homebrew/opt/libpq/bin:$PATH" | |
| # =brew reinstall curl | |
| #export PATH="/opt/homebrew/opt/curl/bin:$PATH" | |
| # export PATH="/usr/local/opt/curl/bin:$PATH" | |
| # For compilers to find curl you may need to set: | |
| #export LDFLAGS="-L/opt/homebrew/opt/curl/lib" | |
| #export CPPFLAGS="-I/opt/homebrew/opt/curl/include" | |
| # Android Studio | |
| export ANDROID_HOME=$HOME/Library/Android/sdk | |
| export PATH=$ANDROID_HOME/platform-tools:$PATH | |
| export PATH=$ANDROID_HOME/emulator:$PATH | |
| # export NODE_OPTIONS=--openssl-legacy-provider | |
| # gem の mysql2 のインストールに必要な zstd のパスの設定 | |
| export LIBRARY_PATH=$LIBRARY_PATH:$(brew --prefix zstd)/lib/ | |
| # brew でインストールした mysql-client のパス設定 | |
| export PATH="/opt/homebrew/opt/mysql-client/bin:$PATH" | |
| export LDFLAGS="-L/opt/homebrew/opt/mysql-client/lib" | |
| export CPPFLAGS="-I/opt/homebrew/opt/mysql-client/include" | |
| # gem の設定 | |
| export PATH="/opt/homebrew/opt/mysql-client/bin:$PATH" | |
| # ------------------------------ | |
| # 設定 | |
| # ------------------------------ | |
| # Oh My Zsh | |
| plugins=( | |
| # docker-compose | |
| asdf | |
| aws | |
| docker | |
| git | |
| helm | |
| kubectl | |
| terraform | |
| # wget https://raw.github.com/oknowton/zsh-dwim/master/init.zsh -O ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/zsh-dwim.zsh | |
| # zsh-dwim | |
| # git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-completions | |
| zsh-completions | |
| # git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions | |
| zsh-autosuggestions | |
| # git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search | |
| zsh-history-substring-search | |
| # git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting | |
| zsh-syntax-highlighting | |
| ) | |
| source $ZSH/oh-my-zsh.sh | |
| # 補完機能有効化 | |
| # ref: https://qiita.com/ayihis@github/items/88f627b2566d6341a741 | |
| # chmod 755 /usr/local/share/zsh/site-functions | |
| # chmod 755 /usr/local/share/zsh | |
| # rm -f ~/.zcompdump | |
| autoload -U compinit && compinit | |
| # enhancd | |
| # git clone https://github.com/b4b4r07/enhancd.git ~/.local/enhancd | |
| # =brew install fzy | |
| source ~/.local/enhancd/init.sh | |
| # fzf 有効化 | |
| # git clone https://github.com/junegunn/fzf.git ~/.local/fzf | |
| # ~/.local/fzf/install | |
| [ -f ~/.local/fzf.zsh ] && source ~/.local/fzf.zsh | |
| # kubectl | |
| export PATH="/usr/local/Cellar/kubernetes-cli/1.18.1/bin:$PATH" | |
| # local bin | |
| export PATH="~/bin:$PATH" | |
| # kube-ps1 | |
| # =brew install kube-ps1 | |
| # source "/usr/local/opt/kube-ps1/share/kube-ps1.sh" | |
| # PS1='$(kube_ps1)'$PS1 | |
| # kubeoff | |
| # direnv ディレクトリ単位で環境変数切り替え | |
| export EDITOR=vim | |
| eval "$(direnv hook zsh)" | |
| # ------------------------------ | |
| # コマンドの別名 | |
| # ------------------------------ | |
| # =brew install macos-trash | |
| if type trash > /dev/null 2>&1; then | |
| alias rm='trash' | |
| fi | |
| # git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.11.3 | |
| # echo "legacy_version_file = yes" > ~/.asdfrc | |
| # ブランチは https://github.com/asdf-vm/asdf で確認 | |
| # asdf plugin add nodejs | |
| . "$HOME/.asdf/asdf.sh" | |
| # brew | |
| alias bi='brew install' | |
| alias bic='brew install --cask' | |
| # Docker | |
| alias drmi='docker rmi' | |
| alias drmif='docker rmi -f' | |
| # @ `none` イメージを一括削除する | |
| alias drmin='docker rmi $(docker images -f "dangling=true" -q)' | |
| alias di='docker images' | |
| alias drit='docker run --rm -it' | |
| alias dps='docker ps' | |
| alias dpsa='docker ps -a' | |
| alias de='docker exec -it' | |
| # Docker Compose | |
| alias dcbf='docker compose build --no-cache' | |
| alias dcer='docker compose exec --user root' | |
| # docker-compose plugin 置き換え | |
| alias dcb='docker-compose build' | |
| alias dcdn='docker compose down' | |
| alias dce='docker compose exec' | |
| alias dck='docker compose kill' | |
| alias dcl='docker compose logs' | |
| alias dclf='docker compose logs -f' | |
| alias dcps='docker compose ps' | |
| alias dcpull='docker compose pull' | |
| alias dcr='docker compose run' | |
| alias dcrestart='docker compose restart' | |
| alias dcrm='docker compose rm' | |
| alias dcstart='docker compose start' | |
| alias dcstop='docker compose stop' | |
| alias dcup='docker compose up' | |
| alias dcupb='docker compose up --build' | |
| alias dcupd='docker compose up -d' | |
| #alias dcdb='docker commit $(docker ps -a | head -n 2 | tail -n 1 | awk '{ print $1 }') debug' | |
| alias dvp='docker volume prune' | |
| alias dvrmf='docker volume rm -f' | |
| alias dcdnv='docker compose down -v' | |
| # Docker Compose for dev | |
| alias ddcupd='docker compose -f docker-compose.dev.yml up -d' | |
| alias ddcstop='docker compose -f docker-compose.dev.yml stop' | |
| alias ddcdnv='docker compose -f docker-compose.dev.yml down -v' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment