]> gitweb @ CieloNegro.org - sugar.git/blob - dot-files/_zshrc
Merge branch 'master' of ssh://www@nem.cielonegro.org/home/www/git.cielonegro.org...
[sugar.git] / dot-files / _zshrc
1 #!/bin/zsh
2 bindkey -e
3
4 stty -ixon ixany
5 stty erase '^H'
6
7 zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z} r:|[/]=* r:|=*'
8 zstyle ':completion:*' use-cache true
9
10 if [ -d "$HOME/.zfunc" ]; then
11     fpath=($HOME/.zfunc $fpath)
12     autoload -U ~/.zfunc/*(:t)
13     function r() {
14         local f
15         f=(~/.zfunc/*(.))
16         unfunction $f:t 2> /dev/null
17         autoload -U $f:t
18     }
19 fi
20
21 if [ -f "$HOME/.ssh/known_hosts" ]; then
22     _cache_hosts=(`perl -ne  'if (/^([a-zA-Z0-9.-]+)/) { print "$1\n";}' ~/.ssh/known_hosts`)
23 fi
24
25 autoload -U colors
26 colors
27
28 setopt no_beep
29 setopt auto_cd
30 setopt auto_list
31 setopt auto_menu
32 setopt auto_name_dirs
33 setopt auto_param_keys
34 setopt auto_param_slash
35 setopt auto_remove_slash
36 setopt c_bases
37 setopt chase_links
38 setopt complete_aliases
39 setopt correct
40 setopt equals
41 setopt glob_complete
42 setopt prompt_bang
43 setopt prompt_percent
44 setopt prompt_subst
45 setopt pushd_ignore_dups
46 setopt pushd_to_home
47 setopt sh_file_expansion
48 setopt always_last_prompt
49 setopt extended_glob
50 setopt hist_ignore_all_dups
51 setopt hist_ignore_space
52 setopt inc_append_history
53 setopt share_history
54
55 function _we_are_in_gnu_screen () {
56     [ "$WINDOW" != "" ]
57 }
58
59 _prompt_base='%B[%n@%m] %{%(?.$fg[green].$fg[red])%}%#%{$reset_color%}%b '
60 if ( _we_are_in_gnu_screen ); then
61     # Magic escape sequence for GNU Screen to update their titles
62     # dynamically by grabbing prompt line.
63     PROMPT=$'%{\ek\e\\%}'$_prompt_base
64 else
65     PROMPT=$_prompt_base
66 fi
67
68 RPROMPT='%U%D{%m/%d}%u %U%D{%T}%u %U%~%u'
69
70 HISTFILE="$HOME/.zhistory"
71 HISTSIZE=6000000
72 SAVEHIST=6000000
73
74 alias -g L="| $PAGER"
75 alias -g G="| grep"
76 alias -g H="| head"
77 alias -g T="| tail"
78
79 alias ..='cd ..'
80 alias cd..='cd ..'
81 alias p='pushd'
82 alias o='popd'
83 alias d='dirs'
84 alias df='df -h'
85 alias ed='ed -p "ed> "'
86 alias du='du -k'
87 alias nc='nc -vv'
88 alias mwget="wget --user-agent='Mozilla/1.4b'"
89 alias pstow="pushd /usr/local/stow"
90 alias w3m="w3m -O UTF-8"
91 alias w3mb="w3m -O UTF-8 -B"
92 alias pkgsrc="pushd /usr/pkgsrc"
93
94 if [ $(hostname) = "aria.cielonegro.org" ]; then
95     alias safari="open -a Safari"
96     alias unstuff='open -a StuffIt\ Expander.app'
97     alias pa='open -a NiseRingo.app'
98     alias heboris='open /Applications/HeborisUEMac/exe/Heboris\ OpenGL.app'
99     alias hengband='open ~/Applications/hengband*/Hengband*'
100 fi
101
102 if [ $(uname) = "Darwin" ]; then
103     alias ldd="otool -L"
104
105     alias ls='ls -Fw'
106     alias la='ls -aw'
107     alias l='ls -lw'
108     alias lls='ls -law'
109 else
110     alias ls='ls -F'
111     alias la='ls -a'
112     alias l='ls -l'
113     alias lls='ls -la'
114 fi
115
116 # The following lines were added by compinstall
117
118 zstyle :compinstall filename "$HOME/.zshrc"
119
120 autoload -U compinit
121 compinit
122 # End of lines added by compinstall
123
124 if [ "x$WINDOW" = "x" ]; then
125     if which fortune 2>&1 >/dev/null; then
126         fortune
127     fi
128 fi
129
130 if [ -e ".motd" ]; then
131     cat .motd
132 fi
133
134 if which ssh-agent-manager 2>&1 >/dev/null; then
135     eval `ssh-agent-manager -s`
136 fi