Add/Update header of /etc/skel/.zshrc and /etc/zsh/zshrc, add debian/NEWS entry
[grml-etc-core.git] / etc / zsh / zshrc
index f78f927..f38eb9e 100644 (file)
@@ -1,4 +1,4 @@
-# Filename:      zshrc
+# Filename:      /etc/zsh/zshrc
 # Purpose:       config file for zsh (z shell)
 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
 # Bug-Reports:   see http://grml.org/bugs/
@@ -512,12 +512,6 @@ fi
 # do Fink setup on darwin
 isdarwin && xsource /sw/bin/init.sh
 
-# set width of man pages to 80 for more convenient reading
-# export MANWIDTH=${MANWIDTH:-80}
-
-# Search path for the cd command
-#  cdpath=(.. ~)
-
 # completion functions go to /etc/zsh/completion.d
 # function files may be put into /etc/zsh/functions.d, from where they
 # will be automatically autoloaded.
@@ -2436,6 +2430,9 @@ grmlcomp() {
     zstyle ':completion:*:manuals.*'  insert-sections   true
     zstyle ':completion:*:man:*'      menu yes select
 
+    # provide .. as a completion
+    zstyle ':completion:*' special-dirs ..
+
     # run rehash on completion so new installed program are found automatically:
     _force_rehash() {
         (( CURRENT == 1 )) && rehash
@@ -3837,16 +3834,21 @@ mkmaildir() {
     mkdir -p ${root}/${subdir}/{cur,new,tmp}
 }
 
-# xtrename() rename xterm from within GNU-screen
+#f5# Change the xterm title from within GNU-screen
 xtrename() {
-    if [[ -z ${DISPLAY} ]] ; then
-        printf 'xtrename only makes sense in X11.\n'
-        return 1
+    if [[ ${1} != "-f" ]] ; then
+        if [[ -z ${DISPLAY} ]] ; then
+            printf 'xtrename only makes sense in X11.\n'
+            return 1
+        fi
+    else
+        shift
     fi
     if [[ -z ${1} ]] ; then
-        printf 'usage: xtrename() "title for xterm"\n'
+        printf 'usage: xtrename [-f] "title for xterm"\n'
         printf '  renames the title of xterm from _within_ screen.\n'
-        printf '  Also works without screen.\n'
+        printf '  also works without screen.\n'
+        printf '  will not work if DISPLAY is unset, use -f to override.\n'
         return 0
     fi
     print -n "\eP\e]0;${1}\C-G\e\\"