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