2 # -*- mode: shell-script -*-
4 # In Emacs, use M-x folding. Quick reference:
6 # Show all sections' text 'C-c @ C-o'
7 # Hide all sections' text 'C-c @ C-w'
8 # Show a section's text 'C-c @ C-s'
9 # Hide a section's text 'C-c @ C-x'
11 # {{{ zstyle completions
13 ## These next 2 lines are from compinstall.
14 zstyle ':completion:*' completer _expand _complete _correct _approximate
15 zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
17 zstyle ':completion:*:options' description 'yes'
18 zstyle ':completion:*:options' auto-description '%d'
20 ## All of the following zstyles are from:
21 ## (http://www.zshwiki.org/cgi-bin/wiki.pl?ZshCompletionTips)
24 ## Some functions, like _apt and _dpkg, are very slow. You can use a cache in
25 ## order to proxy the list of results (like the list of available debian
27 zstyle ':completion:*' use-cache on
28 zstyle ':completion:*' cache-path ~/.zsh/cache
30 ## Prevent CVS files/directories from being completed
31 zstyle ':completion:*:(all-|)files' ignored-patterns '(|*/)CVS'
32 zstyle ':completion:*:cd:*' ignored-patterns '(*/)#CVS'
34 # Allow zsh to complete on hostnames found in common config files.
36 _myhosts=( ${${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) /dev/null)"}%%[# ]*}//,/ }:#\!*}
37 ${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2>/dev/null))"}%%\#*}
39 zstyle ':completion:*' hosts $_myhosts;
41 ## With commands like `rm' it's annoying if one gets offered the same filename
42 ## again even if it is already on the command line. To avoid that:
44 zstyle ':completion:*:rm:*' ignore-line yes
46 ## Load the completion module.
47 zstyle :compinstall filename '/home/zyrnix/.zshrc'
54 # Enable this for a nice interactive way to get a decent prompt.
55 # autoload -U promptinit
58 ## At the command line, you can do this to see the various prompts:
59 # prompt -l # display all
62 # This is based on adam1 from promptinit. I altered it so it includes a
63 # history number and return code. It does not truncate the path.
65 # It looks like this (with colors):
66 # 384 zyrnix@server ~/tmp %
68 PS1=$'%h %{\e[22;44m%}%n@%m%{\e[00m%} %{\e[01;36m%}%0~%{\e[01;37m%} %# %{\e[00m%}'
73 ## FAQ 3.5 How do I get the meta key to work on my xterm?
74 ## http://zsh.sourceforge.net/FAQ/zshfaq03.html#l21
75 [[ $TERM = "xterm" ]] && stty pass8 && bindkey -me
77 ## FAQ 3.6 How do I automatically display the directory in my xterm title bar?
78 ## http://zsh.sourceforge.net/FAQ/zshfaq03.html#l22
80 ## I modified the xterm version because it was too plain.
84 sun-cmd) print -Pn "\e]l%~\e\\"
86 *xterm*|rxvt|(dt|k|E)term) print -Pn "\e]2;% [zsh $ZSH_VERSION] %n@%m: %~\a"
94 ## FAQ 3.18: Why does zsh kill off all my background jobs when I logout?
95 ## http://zsh.sourceforge.net/FAQ/zshfaq03.html#l34
98 ## Or start jobs with &! instead of & to disown them
99 ## (disown = don't kill at logout)
101 ## FAQ 3.21: Why is my history not being saved?
102 ## http://zsh.sourceforge.net/FAQ/zshfaq03.html#l37
104 ## I modified this to allow for 2,000 entries instead of 200.
106 HISTFILE=~/.zsh_history
109 ## FAQ 3.23: How do I prevent the prompt overwriting output when there is no
111 ## http://zsh.sourceforge.net/FAQ/zshfaq03.html#l39
113 ## According to the manual, this prevents multi-line editing because the editor
114 ## does not know where the start of the line appears.
119 # {{{ General setopts
121 ## Don't clobber files by default. Force myself to use >! or >| and >>! or >>|
122 ## to clobber the file
125 ## I use dvorak, so correct spelling mistakes that a dvorak user would make
129 ## Instead of just a list of commands, append it with this:
130 ## `:<beginning time since epoch>:<elapsed seconds>:<command>'.
131 setopt extended_history
133 ## Automatically append directories to the push/pop list
136 ## Maximum size of the directory stack
139 ## Allow for 10MB max coredumps
140 limit coredumpsize 10m
143 # {{{ Emacs compatibility
145 ## FAQ 3.10: Why does zsh not work in an Emacs shell mode any more?
146 ## http://zsh.sourceforge.net/FAQ/zshfaq03.html#l26
147 [[ $EMACS = t ]] && unsetopt zle
149 # Enable emacs keymap
152 # From resolve (http://repose.cx/conf/.zshrc)
153 WORDCHARS='' # Emacs compatible M-b and M-f
154 bindkey "\C-w" kill-region # Emacs C-w command support
159 ## Watch for logins and logouts from all accounts including mine.
162 ## Watch every 30 seconds
165 ## Change the watch format to something more informative
166 # %n = username, %M = hostname, %a = action, %l = tty, %T = time,
168 WATCHFMT="%n from %M has %a tty%l at %T %W"
174 alias ls="ls --color=auto"
175 alias targx="tar -zxvf"
176 alias targc="tar -cxvf"
177 alias tarbx="tar --bzip2 -xvf"
178 alias tarbc="tar --bzip2 -cvf"
181 # {{{ Setopts from Resolve
183 ## From resolve's config (http://repose.cx/conf/.zshrc)
184 setopt extended_glob # Weird & wacky pattern matching - yay zsh!
185 setopt complete_in_word # Not just at the end
186 setopt always_to_end # When complete from middle, move cursor
187 setopt correct # Spelling correction
188 setopt hist_verify # When using ! cmds, confirm first
189 setopt interactive_comments # Escape commands so I can use them later
190 setopt print_exit_value # Alert me if something's failed
192 ## Anti-aliasing in the two toolkits
193 ## Use this type of assignment to set the variable if not already set
194 (( ${+QT_XFT} )) || export QT_XFT=1
195 (( ${+GDK_USE_XFT} )) || export GDK_USE_XFT=1
198 # {{{ GNU Arch tagline - Do not edit this section
200 # To insert a uuid with Linux kernel 2.3.16 or newer, do:
201 # echo -e "\n# arch-tag: `cat /proc/sys/kernel/random/uuid`\n" >> file
203 # arch-tag: 223a17f5-7c19-4f32-8fa7-0c14054128be