zshrc: provide upgrade path via /etc/skel/.zshrc
[grml-etc-core.git] / etc / skel / .zshrc
index 776f6e7..2cee09b 100644 (file)
@@ -1,6 +1,10 @@
-## skel/.zshrc on grml systems
-#
-# Nowadays, grml's zsh setup lives in only in *one* zshrc file.
+# Filename:      /etc/skel/.zshrc
+# Purpose:       config file for zsh (z shell)
+# Authors:       (c) grml-team (grml.org)
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2 or any later version.
+################################################################################
+# Nowadays, grml's zsh setup lives in only *one* zshrc file.
 # That is the global one: /etc/zsh/zshrc (from grml-etc-core).
 # It is best to leave this file untouched and do personal changes to
 # the setup via ${HOME}/.zshrc.local which is loaded at the end of the
 # That way, we enable people on other operating systems to use our
 # setup, too, just by copying our global zshrc to their ${HOME}/.zshrc.
 # Adjustments would still go to the .zshrc.local file.
-#
-
+################################################################################
+
+## Upgrade path for old zshrc layout, assuming
+## /etc/skel/.zshrc installed as .zshrc and
+## /etc/zsh/zshrc installed as .zshrc.global
+## and no ~/.zshrc.local exists yet.
+if [ -r ~/.zshrc -a -r ~/.zshrc.global -a ! -r ~/.zshrc.local ] ; then
+    printf '-!-\n'
+    printf '-!- Looks like you are using the old zshrc layout of grml.\n'
+    printf '-!- Please read the notes in ~/.zshrc and ~/.zshrc.global\n'
+    printf '-!- and/or check out grml-zsh-refcard at http://grml.org/zsh/\n'
+    printf '-!-\n'
+fi
 
 ## Now, we'll give a few examples of what you might want to use in your
 ## .zshrc.local file (just copy'n'paste and uncomment it there):
 
-
 ## ZLE tweaks ##
 
 ## use the vi navigation keys (hjkl) besides cursor keys in menu completion
 #)
 #zstyle ':completion:*:*:telnet:*' users-hosts-ports $telnet_users_hosts_ports
 
+## the default grml setup provides '..' as a completion. it does not provide
+## '.' though. If you want that too, use the following line:
+#zstyle ':completion:*' special-dirs true
 
 ## aliases ##
 
 
 ## miscellaneous code ##
 
+## Use a default width of 80 for manpages for more convenient reading
+#export MANWIDTH=${MANWIDTH:-80}
+
+## Set a search path for the cd builtin
+#cdpath=(.. ~)
+
 ## variations of our manzsh() function; pick you poison:
 #manzsh()  { /usr/bin/man zshall |  most +/"$1" ; }
 #[[ -f ~/.terminfo/m/mostlike ]] && MYLESS='LESS=C TERMINFO=~/.terminfo TERM=mostlike less' || MYLESS='less'