1 # Filename: /etc/skel/.zshrc
2 # Purpose: config file for zsh (z shell)
3 # Authors: (c) grml-team (grml.org)
4 # Bug-Reports: see http://grml.org/bugs/
5 # License: This file is licensed under the GPL v2 or any later version.
6 ################################################################################
7 # Nowadays, grml's zsh setup lives in only *one* zshrc file.
8 # That is the global one: /etc/zsh/zshrc (from grml-etc-core).
9 # It is best to leave *this* file untouched and do personal changes to
10 # your zsh setup via ${HOME}/.zshrc.local which is loaded at the end of
13 # That way, we enable people on other operating systems to use our
14 # setup, too, just by copying our global zshrc to their ${HOME}/.zshrc.
15 # Adjustments would still go to the .zshrc.local file.
16 ################################################################################
18 ## Inform users about upgrade path for grml's old zshrc layout, assuming that:
19 ## /etc/skel/.zshrc was installed as ~/.zshrc,
20 ## /etc/zsh/zshrc was installed as ~/.zshrc.global and
21 ## ~/.zshrc.local does not exist yet.
22 if [ -r ~/.zshrc -a -r ~/.zshrc.global -a ! -r ~/.zshrc.local ] ; then
24 printf '-!- Looks like you are using the old zshrc layout of grml.\n'
25 printf '-!- Please read the notes in the grml-zsh-refcard, being'
26 printf '-!- available at: http://grml.org/zsh/\n'
28 printf '-!- If you just want to get rid of this warning message execute:\n'
29 printf '-!- touch ~/.zshrc.local\n'
33 ## Now, we'll give a few examples of what you might want to use in your
34 ## .zshrc.local file (just copy'n'paste and uncomment it there):
38 ## use the vi navigation keys (hjkl) besides cursor keys in menu completion
39 #bindkey -M menuselect 'h' vi-backward-char # left
40 #bindkey -M menuselect 'k' vi-up-line-or-history # up
41 #bindkey -M menuselect 'l' vi-forward-char # right
42 #bindkey -M menuselect 'j' vi-down-line-or-history # bottom
44 ## set command prediction from history, see 'man 1 zshcontrib'
45 #is4 && zrcautoload predict-on && \
46 #zle -N predict-on && \
47 #zle -N predict-off && \
48 #bindkey "^X^Z" predict-on && \
49 #bindkey "^Z" predict-off
51 ## press ctrl-q to quote line:
53 # zle beginning-of-line
55 # # RBUFFER="'$RBUFFER'"
56 # RBUFFER=${(q)RBUFFER}
59 #zle -N mquote && bindkey '^q' mquote
61 ## define word separators (for stuff like backward-word, forward-word, backward-kill-word,..)
62 #WORDCHARS='*?_-.[]~=/&;!#$%^(){}<>' # the default
64 #WORDCHARS='*?_[]~=&;!#$%^(){}'
65 #WORDCHARS='${WORDCHARS:s@/@}'
68 ## some popular options ##
70 ## add `|' to output redirections in the history
71 #setopt histallowclobber
73 ## warning if file exists ('cat /dev/null > ~/.zshrc')
76 ## don't warn me about bg processes when exiting
79 ## alert me if something failed
80 #setopt printexitvalue
82 ## with spelling correction, assume dvorak kb
85 ## Allow comments even in interactive shells
86 #setopt interactivecomments
89 ## compsys related snippets ##
91 ## changed completer settings
92 #zstyle ':completion:*' completer _complete _correct _approximate
93 #zstyle ':completion:*' expand prefix suffix
95 ## another different completer setting: expand shell aliases
96 #zstyle ':completion:*' completer _expand_alias _complete _approximate
98 ## to have more convenient account completion, specify your logins:
100 # {grml,grml1}@foo.invalid
101 # grml-devel@bar.invalid
104 # {fred,root}@foo.invalid
107 #zstyle ':completion:*:my-accounts' users-hosts $my_accounts
108 #zstyle ':completion:*:other-accounts' users-hosts $other_accounts
110 ## telnet on non-default ports? ...well:
111 ## specify specific port/service settings:
112 #telnet_users_hosts_ports=(
115 # @mail-server:{smtp,pop3}
119 #zstyle ':completion:*:*:telnet:*' users-hosts-ports $telnet_users_hosts_ports
121 ## the default grml setup provides '..' as a completion. it does not provide
122 ## '.' though. If you want that too, use the following line:
123 #zstyle ':completion:*' special-dirs true
128 #alias u='translate -i'
130 ## ignore ~/.ssh/known_hosts entries
131 #alias insecssh='ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null" -o "PreferredAuthentications=keyboard-interactive"'
134 ## global aliases (for those who like them) ##
136 #alias -g '...'='../..'
137 #alias -g '....'='../../..'
138 #alias -g BG='& exit'
142 #alias -g Hl=' --help |& less -r'
145 #alias -g LL='|& less -r'
147 #alias -g N='&>/dev/null'
148 #alias -g R='| tr A-z N-za-m'
149 #alias -g SL='| sort | less'
152 #alias -g V='| vim -'
154 ## miscellaneous code ##
156 ## Use a default width of 80 for manpages for more convenient reading
157 #export MANWIDTH=${MANWIDTH:-80}
159 ## Set a search path for the cd builtin
162 ## variation of our manzsh() function; pick you poison:
163 #manzsh() { /usr/bin/man zshall | most +/"$1" ; }
165 ## Switching shell safely and efficiently? http://www.zsh.org/mla/workers/2001/msg02410.html
167 # NO_SWITCH="yes" command bash "$@"
170 # exec $SHELL $SHELL_ARGS "$@"
173 ## log out? set timeout in seconds...
174 ## ...and do not log out in some specific terminals:
175 #if [[ "${TERM}" == ([Exa]term*|rxvt|dtterm|screen*) ]] ; then
181 ## associate types and extensions (be aware with perl scripts and anwanted behaviour!)
182 #check_com zsh-mime-setup || { autoload zsh-mime-setup && zsh-mime-setup }
183 #alias -s pl='perl -S'
185 ## ctrl-s will no longer freeze the terminal.
188 ## you want to automatically use a bigger font on big terminals?
189 #if [[ "$TERM" == "xterm" ]] && [[ "$LINES" -ge 50 ]] && [[ "$COLUMNS" -ge 100 ]] && [[ -z "$SSH_CONNECTION" ]] ; then
193 ## Some quick Perl-hacks aka /useful/ oneliner
194 #bew() { perl -le 'print unpack "B*","'$1'"' }
195 #web() { perl -le 'print pack "B*","'$1'"' }
196 #hew() { perl -le 'print unpack "H*","'$1'"' }
197 #weh() { perl -le 'print pack "H*","'$1'"' }
198 #pversion() { perl -M$1 -le "print $1->VERSION" } # i. e."pversion LWP -> 5.79"
199 #getlinks () { perl -ne 'while ( m/"((www|ftp|http):\/\/.*?)"/gc ) { print $1, "\n"; }' $* }
200 #gethrefs () { perl -ne 'while ( m/href="([^"]*)"/gc ) { print $1, "\n"; }' $* }
201 #getanames () { perl -ne 'while ( m/a name="([^"]*)"/gc ) { print $1, "\n"; }' $* }
202 #getforms () { perl -ne 'while ( m:(\</?(input|form|select|option).*?\>):gic ) { print $1, "\n"; }' $* }
203 #getstrings () { perl -ne 'while ( m/"(.*?)"/gc ) { print $1, "\n"; }' $*}
204 #getanchors () { perl -ne 'while ( m/«([^«»\n]+)»/gc ) { print $1, "\n"; }' $* }
205 #showINC () { perl -e 'for (@INC) { printf "%d %s\n", $i++, $_ }' }
206 #vimpm () { vim `perldoc -l $1 | sed -e 's/pod$/pm/'` }
207 #vimhelp () { vim -c "help $1" -c on -c "au! VimEnter *" }
209 ## END OF FILE #################################################################