2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

俺のzshrc

Posted at

cat /etc/shells
exec $SHELL
chsh
chsh -s /usr/local/bin/zsh

setopt hist_reduce_blanks # スペース排除
setopt share_history # 履歴ファイルを共有
setopt EXTENDED_HISTORY # zshの開始終了を記録

# history 操作
setopt hist_reduce_blanks # スペース排除
setopt share_history # 履歴ファイルを共有
setopt EXTENDED_HISTORY # zshの開始終了を記録

# history 操作
autoload history-search-end
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
bindkey "^P" history-beginning-search-backward-end
bindkey "^N" history-beginning-search-forward-end
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt hist_ignore_dups

# alias
zstyle ':completion:*' list-colors 'di=34' 'ln=35' 'so=32' 'ex=31' 'bd=46;34' 'cd=43;34'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias vi=vim # vi で vim 起動
alias -g G='| grep'
alias -g L='| less'
alias -g H='| head'
alias -g T='| tail'
alias -g S='| sort'
alias -g W='| wc'
alias -g X='| xargs'
alias sudo='sudo -E env PATH=$PATH '
alias rs='rails server'
alias rc='rails console'
alias sudo='sudo -E env PATH=$PATH '
alias du="du -h"
alias df="df -h"
alias la='ls -la'
alias ll='ls -la'

alias redis.start="launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist"
alias redis.stop="launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.redis.plist"
alias redis.restart='redis.stop && redis.start'

alias ctags="`brew --prefix`/bin/ctags"

# 予測
autoload predict-on
predict-on

# リダイレクト機能 複数ファイル対応
setopt multios

# 数値処理関数を使う
zmodload -i zsh/mathfunc

# ハイライトを消す
# set hlsearch
# nnoremap <ESC><ESC> :nohlsearch<CR>

# jjでインサートモードから戻る
# inoremap <silent> jj <ESC>

#zshエディタ機能
autoload zed

export PGDATA=/usr/local/var/postgres

#gitのコマンド補完
source /usr/local/etc/bash_completion.d/git-prompt.sh
# source /usr/local/etc/bash_completion.d/git-completion.bash
source /usr/local/share/zsh/site-functions/git-completion.bash

#プロンプトの設定

#s_infoロード    
autoload -Uz vcs_info    
# PROMPT変数内で変数参照する    
setopt prompt_subst    

# vcsの表示    
zstyle ':vcs_info:*' formats '%s][* %F{green}%b%f'    
zstyle ':vcs_info:*' actionformats '%s][* %F{green}%b%f(%F{red}%a%f)'    
# プロンプト表示直前にvcs_info呼び出し    
precmd() { vcs_info }    
# プロンプト表示    
PROMPT='[${vcs_info_msg_0_}]:%~/%f '  

[ -f ~/.zshrc.include ] && source ~/.zshrc.include # 設定ファイルのinclude
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?