]> git.openstreetmap.org Git - chef.git/blob - cookbooks/accounts/files/default/tomh/.zshrc
imagery: enable 2 further gb_os_sv diff layers
[chef.git] / cookbooks / accounts / files / default / tomh / .zshrc
1 # Set file creation mask
2 umask 002
3
4 # # No core dumps
5 limit coredumpsize 0
6
7 # Terminal initialization
8 stty -ixon
9 ttyctl -f
10
11 # Make sure we know the username
12 if [[ -z "$USER" ]]
13 then
14     USER=`logname`; export USER
15 fi
16
17 # Setup a default path
18 PATH=.:$HOME/bin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R6/bin
19
20 # Setup a pager
21 PAGER=less; export PAGER
22 LESS=aceiMs; export LESS
23
24 # Use vi for editing
25 EDITOR=/usr/bin/vi; export EDITOR
26 VISUAL=/usr/bin/vi; export VISUAL
27
28 # Z-shell options
29 setopt ALL_EXPORT
30 setopt AUTO_CD
31 setopt AUTO_LIST
32 setopt AUTO_MENU
33 setopt CDABLE_VARS
34 setopt CORRECT
35 setopt CORRECT_ALL
36 setopt EXTENDED_GLOB
37 setopt HIST_IGNORE_DUPS
38 setopt HIST_NO_STORE
39 setopt LIST_AMBIGUOUS
40 setopt LIST_TYPES
41 setopt LONG_LIST_JOBS
42 setopt NO_BEEP
43 setopt NO_NOMATCH
44 setopt NOTIFY
45 setopt RC_EXPAND_PARAM
46 setopt SH_WORD_SPLIT
47
48 # Keep tramp happy
49 if [[ "$TERM" = "dumb" ]]
50 then
51     unsetopt ZLE
52 fi
53
54 # History setup
55 HISTFILE=$HOME/.zshhistory
56 SAVEHIST=200
57 HISTSIZE=200
58
59 # Files to ignore when completing
60 fignore=( \~ \# .o )
61
62 # Set the prompt
63 if [[ "$TERM" == "xterm" ]]
64 then
65     PROMPT="%{\e]2;%M\a%}%m [%~] %# "
66 else
67     PROMPT="%m [%~] %# "
68 fi
69
70 # Set aliases
71 alias ls="ls -CFh"
72 alias df="df -h"
73 alias du="du -h"
74 alias mv="nocorrect mv"         # no spelling correction on mv
75 alias cp="nocorrect cp"         # no spelling correction on cp
76 alias mkdir="nocorrect mkdir"   # no spelling correction on mkdir
77 alias man="nocorrect man"       # no spelling correction on man
78 alias pg="less"
79 alias mailq="/usr/sbin/exim -bp"
80 alias runq="sudo /usr/sbin/exim -qq"
81 alias mailrm="sudo /usr/sbin/exim -Mrm"
82 alias mailedit="sudo /usr/sbin/exim -Meb"
83 alias mailfreeze="sudo /usr/sbin/exim -Mf"
84 alias mailthaw="sudo /usr/sbin/exim -Mt"
85
86 # ish type history list (zsh: ctrl-v key, emacs ctrl-q key)
87 bindkey "\eOA"  history-beginning-search-backward \
88         "\e[A"  history-beginning-search-backward \
89         "\eOB"  history-beginning-search-forward  \
90         "\e[B"  history-beginning-search-forward  \
91         "\eOU"  end-of-line                       \
92         "\e[U"  end-of-line                       \
93         "^A"    beginning-of-line                 \
94         "^E"    end-of-line                       \
95         "\eOV"  beginning-of-line                 \
96         "\e[V"  beginning-of-line                 \
97         "\eOD"  backward-char                     \
98         "\e[D"  backward-char                     \
99         "\eOC"  forward-char                      \
100         "\e[C"  forward-char                      \
101         "^F"    forward-word                      \
102         "^B"    backward-word                     \
103         "\e[2~" overwrite-mode                    \
104         "^P"    push-line                         \
105         "^K"    kill-line                         \
106         "\e[3~" delete-char
107
108 # Completion options
109 . $HOME/.zcomp
110
111 # Add the local functions to the function search path
112 fpath=($HOME/zshfuncs $fpath)
113
114 # Autoload all functions on the function search path
115 foreach file in $HOME/zshfuncs/*
116 do
117     autoload `basename $file`
118 done