Skip to content

Instantly share code, notes, and snippets.

@stibear
Created June 21, 2013 13:28
Show Gist options
  • Save stibear/5831119 to your computer and use it in GitHub Desktop.
Save stibear/5831119 to your computer and use it in GitHub Desktop.
.zshrc
# .zshrc file for zsh(1)
## Completion configuration
autoload -U -U compinit
compinit
zstyle ':completion:*' list-colors 'di=34' 'ln=35' 'so=32' 'ex=31' 'bd=46;34' 'cd=43;34'
## Environment variable configuration
# LANG
export LANG=ja_JP.UTF-8
case ${UID} in
0)
LANG=C
;;
esac
## Default shell configuration
# set prompt
autoload -U colors
colors
case ${UID} in
0)
PROMPT="%{%}%m:%n%%%{%} "
RPROMPT="[%~]"
PROMPT2="%{%}%_#%{%} "
SPROMPT="%B%{%}%r is correct? [n,y,a,e]:%{%}%b "
[ -n "${REMOTEHOST}${SSH_CONNECTION}" ] &&
PROMPT="%{%}${HOST%%.*} ${PROMPT}"
;;
*)
PROMPT="%{%}%m:%n%%%{%} "
RPROMPT="[%~]"
PROMPT2="%{%}%_%%%{%} "
SPROMPT="%{%}%r is correct? [n,y,a,e]:%{%} "
[ -n "${REMOTEHOST}${SSH_CONNECTION}" ] &&
PROMPT="%{%}${HOST%%.*} ${PROMPT}"
;;
esac
## Command history configuration
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt hist_ignore_dups # ignore duplication command history list
setopt share_history # share command history data
## Keybind configuration
# emacs like keybind
# looking up is 'bindkey -L'
bindkey -e
## auto change directory
setopt auto_cd
## auto directory pushd that you can get dirs list by cd -[tab]
#setopt auto_pushd
## command correct edition before each completion attempt
setopt correct
## compacked complete list display
setopt list_packed
## auto command suggest
autoload -U predict-on
predict-on
## no remove postfix slash of command line
setopt noautoremoveslash
## Alias
alias ls="ls --color=auto -G"
alias battery="acpi -b"
alias su="su -l"
alias l="ls --color=auto -G"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment