zshrc の設定のメモ
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
# コマンド履歴 | |
HISTFILE=~/.zsh_history | |
HISTSIZE=6000000 | |
SAVEHIST=6000000 | |
setopt hist_ignore_dups # ignore duplication command history list | |
setopt share_history # share command history data | |
export ZPLUG_HOME=/usr/local/opt/zplug | |
source $ZPLUG_HOME/init.zsh | |
zplug "zsh-users/zsh-syntax-highlighting", defer:2 | |
zplug "zsh-users/zsh-autosuggestions" | |
zplug "zsh-users/zsh-history-substring-search", hook-build:"__zsh_version 4.3" | |
zplug "zsh-users/zsh-completions" | |
zplug "mafredri/zsh-async", from:github | |
zplug "hchbaw/auto-fu.zsh" | |
zplug "b4b4r07/enhancd", use:init.sh | |
zplug "b4b4r07/zsh-gomi", if:"which fzf" | |
zplug "junegunn/fzf-bin", as:command, from:gh-r, rename-to:fzf | |
export FZF_DEFAULT_OPTS='--height 40% --reverse --border --preview "cat {}"' | |
zplug "plugins/git", from:oh-my-zsh | |
# Source Prezto. | |
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then | |
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" | |
fi | |
# Install plugins if there are plugins that have not been installed | |
if ! zplug check --verbose; then | |
printf "Install? [y/N]: " | |
if read -q; then | |
echo; zplug install | |
fi | |
fi | |
# Then, source plugins and add commands to $PATH | |
zplug load --verbose | |
function peco-history-selection() { | |
BUFFER=`history -n 1 | tail -r | awk '!a[$0]++' | peco` | |
CURSOR=$#BUFFER | |
zle reset-prompt | |
} | |
zle -N peco-history-selection | |
bindkey '^R' peco-history-selection | |
# private settings | |
## GO | |
export GOPATH=$HOME/go | |
export GOENV_ROOT=$HOME/.goenv | |
export PATH=bin:$GOENV_ROOT/bin:$GOPATH/bin:$PATH | |
eval "$(goenv init -)" | |
# rbenv | |
export RBENV_ROOT="$HOME/.rbenv" | |
export PATH="$HOME/.rbenv/bin:$PATH" | |
eval "$(rbenv init -)" | |
export PATH="$HOME/.nodenv/bin:$PATH" | |
eval "$(nodenv init -)" |