.zshrc
author Shingo W. Kagami
Fri, 10 Feb 2012 03:44:27 +0900
changeset 26 5b41a49602f1
parent 10 0afd98c7dab2
permissions -rw-r--r--
Add .emacs for Meadow/Cygwin environment.
     1 HISTFILE=~/.histfile
     2 HISTSIZE=1000000
     3 SAVEHIST=1000000
     4 setopt appendhistory
     5 setopt share_history
     6 setopt hist_ignore_dups
     7 setopt auto_pushd
     8 setopt magic_equal_subst
     9 
    10 bindkey -e
    11 fpath=($fpath /usr/share/zsh/functions/Zle)
    12 
    13 autoload -U compinit
    14 compinit -u
    15 
    16 autoload history-search-end
    17 zle -N history-beginning-search-backward-end history-search-end
    18 zle -N history-beginning-search-forward-end history-search-end
    19 bindkey '^P' history-beginning-search-backward-end
    20 bindkey '^N' history-beginning-search-forward-end
    21 
    22 export CVS_RSH=ssh
    23 export RSYNC_RSH=ssh
    24 export EDITOR=vi
    25 export PAGER=less
    26 export JLESSCHARSET=ja
    27 export LS_COLORS="di=31:ex=34:ln=46:pi=0:so=0:cd=0:bd=0"
    28 
    29 alias ls="ls --color=tty"
    30 alias l="ls -l"
    31 alias lynx="lynx -nopause"
    32 
    33 case "$OSTYPE" in
    34     freebsd*)
    35         alias ls="gnuls --color=tty"
    36         alias emacs=emcws
    37         alias less=jless
    38         ;;
    39     cygwin)
    40         alias start=cygstart
    41         alias ls="ls --color=tty --show-control-chars"
    42         if [ -e ${HOME}/.zshrc.cygwin ]; then
    43             source ${HOME}/.zshrc.cygwin
    44         fi
    45         ;;
    46 esac
    47 
    48 PROMPT=$'%{\e[35m%}%m%#%{\e[m%} '
    49 
    50 HOST3=`hostname | cut -b 1-3`
    51 precmd() {
    52     local PWD2=${PWD/#$HOME/\~}
    53     local DTRUN=$PWD2:t
    54     local DBASE=${DTRUN:-/}
    55     RPROMPT="[$PWD2]"
    56     [ "x$TERM" = "xscreen" ] && echo -n "\ek$HOST3:$DBASE\e\\"
    57 }