Last active
May 20, 2024 16:27
-
-
Save kokiTakashiki/c66101cffa4b73a9459c92231778ab4b to your computer and use it in GitHub Desktop.
zsh Settings
This file contains 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
# 環境変数 | |
export LANG=ja_JP.UTF-8 | |
export PATH=/opt/homebrew/bin:$PATH | |
# ヒストリの設定 | |
HISTFILE=~/.zsh_history | |
HISTSIZE=50000 | |
SAVEHIST=50000 | |
# 直前のコマンドの重複を削除 | |
setopt hist_ignore_dups | |
# 同じコマンドをヒストリに残さない | |
setopt hist_ignore_all_dups | |
# 同時に起動したzshの間でヒストリを共有 | |
setopt share_history | |
# 補完機能を有効にする | |
autoload -Uz compinit | |
compinit -u | |
if [ -e /usr/local/share/zsh-completions ]; then | |
fpath=(/usr/local/share/zsh-completions $fpath) | |
fi | |
# 補完で小文字でも大文字にマッチさせる | |
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' | |
# 補完候補を詰めて表示 | |
setopt list_packed | |
# 補完候補一覧をカラー表示 | |
autoload colors | |
zstyle ':completion:*' list-colors '' | |
# コマンドのスペルを訂正 | |
setopt correct | |
# ビープ音を鳴らさない | |
setopt no_beep | |
# ディレクトリスタック | |
DIRSTACKSIZE=100 | |
setopt AUTO_PUSHD | |
# git | |
autoload -Uz vcs_info | |
setopt prompt_subst | |
zstyle ':vcs_info:git:*' check-for-changes true | |
zstyle ':vcs_info:git:*' stagedstr "%F{magenta}!" | |
zstyle ':vcs_info:git:*' unstagedstr "%F{yellow}+" | |
zstyle ':vcs_info:*' formats "%F{cyan}%c%u[%b]%f" | |
zstyle ':vcs_info:*' actionformats '[%b|%a]' | |
precmd () { vcs_info } | |
# プロンプトカスタマイズ | |
PROMPT=' | |
%F{green}[%D{%Y/%m/%f} %D{%L:%M:%S}]%f | |
[%B%F{red}%n@%m%f%b:%F{green}%~%f]%F{cyan}$vcs_info_msg_0_%f | |
%F{yellow}$%f ' | |
# rubyの環境設定 | |
[[ -d ~/.rbenv ]] && \ | |
export PATH=${HOME}/.rbenv/bin:${PATH} && \ | |
eval "$(rbenv init -)" | |
# Launching ${アプリ名}... で永遠にアプリが起動できなくなったときに debugserverを殺す用 | |
# https://zenn.dev/kymmt/articles/358736431ba19d | |
alias killds='pgrep -f '/Library/Apple/usr/libexec/oah/debugserver' | xargs kill -9' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment