Skip to content

Instantly share code, notes, and snippets.

@ikuyamada
Created June 30, 2011 13:02
Show Gist options
  • Save ikuyamada/1056184 to your computer and use it in GitHub Desktop.
Save ikuyamada/1056184 to your computer and use it in GitHub Desktop.
my zshrc
export LANG=ja_JP.UTF-8
export MAILCHECK=0
export EDITOR=vim
HISTFILE=$HOME/.zsh-history
HISTSIZE=3000
SAVEHIST=3000
PROMPT="%B%n@%m%%%b "
RPROMPT="%B[%~]%b"
setopt transient_rprompt
bindkey -e
setopt extended_history
setopt share_history
setopt hist_ignore_all_dups
setopt append_history
setopt inc_append_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
bindkey "^R" history-incremental-search-backward
bindkey "^S" history-incremental-search-forward
setopt auto_cd
setopt auto_pushd
setopt auto_menu
setopt hist_verify
setopt list_packed
setopt list_types
setopt magic_equal_subst
setopt print_eight_bit
setopt pushd_ignore_dups
# disable Ctrl-s
stty stop undef
autoload -U compinit
compinit
autoload -U colors
colors
alias sudo='env PATH=${PATH}:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin \sudo'
alias re='screen -D -RR'
alias du="du -h"
alias df="df -h"
alias ll="ls -lh"
alias la="ls -a"
alias p="popd"
alias pp="pushd"
alias g="grep --binary-files=without-match --colour=always -r --exclude=\*.svn\*"
alias mysql-start='sudo mysqld_safe5 &'
alias mysql-stop='mysqladmin5 -u root shutdown'
case ${OSTYPE} in
darwin*)
alias ls="ls -G -w"
alias gvim='env LANG=ja_JP.UTF-8 open -a /Applications/MacVim.app "$@"'
alias vim=gvim
;;
linux*)
alias ls="ls --color"
;;
esac
if [ -n "$WINDOW" ]; then
preexec() {
echo -ne "\ek${1%% *}\e\\"
}
precmd() {
echo -ne "\ek$(basename $(pwd))\e\\"
}
function ssh_screen() {
eval server=\@\${$#}
screen -t $server ssh "$@"
}
alias ssh=ssh_screen
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment