Last active
February 7, 2018 05:01
-
-
Save sharapeco/2b588cd2e27a0ae7382385d721075b7f to your computer and use it in GitHub Desktop.
My zsh config
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
autoload -Uz zmv | |
autoload -U compinit | |
compinit | |
autoload -Uz vcs_info | |
autoload colors | |
colors | |
### 補完時に大小文字を区別しない | |
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' | |
zstyle ':completion:*' menu select=1 | |
### 履歴の設定 | |
HISTFILE=~/.zsh_history | |
HISTSIZE=1000 | |
SAVEHIST=10000 | |
setopt HIST_IGNORE_SPACE # 先頭にスペースをつけると履歴に記録しない | |
setopt hist_ignore_dups | |
setopt share_history | |
### 雑多な設定 | |
# ディレクトリ名で cd | |
setopt auto_cd | |
# PROMPT変数内で変数参照 | |
setopt prompt_subst | |
### 環境変数 | |
export SHELL=/bin/zsh | |
export PATH=~/bin:/usr/lib/php/pear/bin:/usr/local/bin:$PATH | |
export DISPLAY=:0.0 | |
export LANG=ja_JP.UTF-8 | |
export LV='-Ou8 -c' | |
export PAGER=lv | |
export EDITOR=vim | |
### エイリアス | |
alias ls='ls -vG' | |
alias ll='ls -lvG' | |
alias la='ls -AvG' | |
alias lla='ls -lAvG' | |
alias vi=vim | |
alias df='df -h' | |
alias du='du -h' | |
alias du1='du -hd1' | |
# git | |
alias gipul='git pull origin master' | |
alias gipsh='git push origin master' | |
alias gico='git commit -am' | |
# dnsmasq の設定を編集 | |
alias dnsedit='vi /usr/local/etc/dnsmasq.conf' | |
# かんたんリネーム | |
autoload -Uz zmv | |
alias zmv='noglob zmv -W' | |
# Mac アプリで開く | |
alias safari='open -a Safari' | |
# 出力をクリップボードにコピー | |
alias -g C="| pbcopy " | |
# misc | |
alias p='perl -e "print eval(join(\" \",@ARGV));"' | |
alias pren='php ~/bin/ren.php' | |
### バージョン管理システムから情報を取得 | |
### http://www.sirochro.com/note/terminal-zsh-prompt-customize/ | |
zstyle ':vcs_info:git:*' check-for-changes true #formats 設定項目で %c,%u が使用可 | |
zstyle ':vcs_info:git:*' stagedstr "%F{green}!" #commit されていないファイルがある | |
zstyle ':vcs_info:git:*' unstagedstr "%F{magenta}+" #add されていないファイルがある | |
zstyle ':vcs_info:*' formats "%F{cyan}%c%u(%b)%f" #通常 | |
zstyle ':vcs_info:*' actionformats '[%b|%a]' #rebase 途中,merge コンフリクト等 formats 外の表示 | |
precmd () { vcs_info } | |
### プロンプトの設定 | |
# PS1='[%n:%~]%# ' | |
# PROMPT='[%~]%# ' | |
PROMPT=$' | |
%{\e[38;5;024m%}[%~]%{\e[m%}${vcs_info_msg_0_}%{\e[38;5;024m%}%#%{\e[m%} ' | |
# RPROMPT=$'%{\e[38;5;036m%}%~%{\e[m%}' | |
source ~/.profile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment