Last active
March 6, 2019 03:33
-
-
Save yu-orz/7656803 to your computer and use it in GitHub Desktop.
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
## | |
## Gernal | |
## | |
#export LANG=C | |
HISTFILE=~/.zsh_history | |
HISTSIZE=10000 | |
SAVEHIST=10000 | |
## include | |
source ~/.zshrc_local | |
## | |
## Option | |
## | |
## compinstall | |
zstyle :compinstall filename '~/.zshrc' | |
autoload -U compinit | |
compinit | |
## go settings | |
export GOPATH=$HOME/.go | |
export PATH=$PATH:$GOPATH/bin | |
## History関連 | |
setopt hist_ignore_all_dups | |
setopt hist_ignore_dups | |
setopt share_history | |
setopt append_history | |
setopt inc_append_history | |
setopt hist_no_store | |
setopt hist_reduce_blanks | |
## 文字化け対策だった気がする | |
setopt print_eight_bit | |
## cd | |
setopt auto_pushd | |
setopt auto_cd | |
## 雑多なあれ | |
zstyle ':completion:*' list-colors 'di=36' 'ln=35' | |
setopt correct | |
setopt list_packed | |
setopt list_types | |
setopt noautoremoveslash | |
setopt magic_equal_subst | |
setopt pushd_ignore_dups | |
setopt prompt_subst | |
setopt transient_rprompt | |
setopt no_multios | |
unsetopt promptcr | |
#setopt rm_star_wait | |
unsetopt no_clobber | |
setopt NO_flow_control | |
#setopt ignore_eof | |
setopt interactive_comments | |
#setopt vi | |
setopt emacs | |
bindkey "" history-incremental-search-backward | |
setopt complete_aliases | |
## nohup | |
setopt no_hup | |
setopt no_checkjobs | |
setopt notify | |
## git | |
autoload -Uz vcs_info | |
# PROMPT変数内で変数参照する | |
setopt prompt_subst | |
# VCSの情報を取得するzshの便利関数 vcs_infoを使う | |
autoload -Uz vcs_info | |
# 表示フォーマットの指定 | |
# %b ブランチ情報 | |
# %a アクション名(mergeなど) | |
zstyle ':vcs_info:*' formats '[%b]' | |
zstyle ':vcs_info:*' actionformats '[%b|%a]' | |
precmd () { | |
psvar=() | |
LANG=en_US.UTF-8 vcs_info | |
[[ -n "$vcs_info_msg_0_" ]] && psvar[1]="$vcs_info_msg_0_" | |
} | |
# | |
# Color | |
# | |
DEFAULT=$'%{\e[1;0m%}' | |
GREEN=$'%{\e[1;32m%}' | |
BLUE=$'%{\e[1;34m%}' | |
# | |
# Prompt | |
# | |
autoload colors | |
colors | |
# プロンプト表示 | |
PROMPT="%{${fg[$DEFAULT]}%}[%n@%m] %(!.#.$) %{${reset_color}%}" | |
PROMPT2="%{${fg[$DEFAULT]}%}%_> %{${reset_color}%}" | |
SPROMPT="%{${fg[$DEFAULT]}%}correct: %R -> %r [nyae]? %{${reset_color}%}" | |
#RPROMPT="%{${fg[blue]}%}[%~]%{${reset_color}%}" | |
RPROMPT="%1(v|%F{green}%1v%f|)%{${fg[blue]}%}[%~]%{${reset_color}%}" | |
#[ -n "${REMOTEHOST}${SSH_CONNECTION}" ] && PROMPT="%{7m%}${HOST%%.*} ${PROMPT}" | |
# aliases | |
alias ls='ls --color=auto' | |
alias ll='ls -a -l' | |
alias grep='grep --color=auto' | |
alias fgrep='fgrep --color=auto' | |
alias egrep='egrep --color=auto' | |
alias emacs='/Applications/Emacs.app/Contents/MacOS/Emacs' | |
alias dc='cd' | |
#alias vim='/Applications/MacVim.app/Contents/MacOS/Vim "$@"' | |
#alias vi='/Applications/MacVim.app/Contents/MacOS/Vim "$@"' | |
eval "$(hub alias -s)" | |
## | |
## Environment | |
## | |
PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" | |
PATH="/usr/local/opt/findutils/libexec/gnubin:$PATH" | |
PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH" | |
PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" | |
PATH="/usr/local/opt/grep/libexec/gnubin:$PATH" | |
export PATH=$PATH | |
MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH" | |
MANPATH="/usr/local/opt/findutils/libexec/gnuman:$MANPATH" | |
MANPATH="/usr/local/opt/gnu-sed/libexec/gnuman:$MANPATH" | |
MANPATH="/usr/local/opt/gnu-tar/libexec/gnuman:$MANPATH" | |
MANPATH="/usr/local/opt/grep/libexec/gnuman:$MANPATH" | |
export MANPATH=$MANPATH | |
export GIT_EDITOR=`which vim` | |
umask 022 | |
#eval "$(rbenv init - zsh)" | |
# ディレクトリごとに区切る | |
# http://mollifier.hatenablog.com/entry/20081214/1229229752 | |
autoload -Uz select-word-style | |
select-word-style default | |
zstyle ':zle:*' word-chars " /=;@:{},|" | |
zstyle ':zle:*' word-style unspecified | |
zmodload -i zsh/complist | |
autoload -Uz compinit && compinit | |
zstyle ':completion:*:default' menu select=2 | |
# 補完時にhjklで選択 | |
bindkey -M menuselect 'h' vi-backward-char | |
bindkey -M menuselect 'j' vi-down-line-or-history | |
bindkey -M menuselect 'k' vi-up-line-or-history | |
bindkey -M menuselect 'l' vi-forward-char | |
## peco | |
function peco-select-history() { | |
local tac | |
if which tac > /dev/null; then | |
tac="tac" | |
else | |
tac="tail -r" | |
fi | |
BUFFER=$(\history -n 1 | \ | |
eval $tac | \ | |
peco --query "$LBUFFER") | |
CURSOR=$#BUFFER | |
zle clear-screen | |
} | |
zle -N peco-select-history | |
bindkey '^r' peco-select-history | |
## awscli complate | |
source /usr/local/bin/aws_zsh_completer.sh | |
## aws settings | |
export AWS_CONFIG_FILE="~/.aws/config" | |
export BOTO_CONFIG=$AWS_CONFIG_FILE | |
## pyenv | |
export PYENV_ROOT="$HOME/.pyenv" | |
export PATH="$PYENV_ROOT/bin:$PATH" | |
eval "$(pyenv init -)" | |
## GHE | |
alias ghe="GITHUB_HOST=${GITHUB_HOST} git" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment