zshrc: Removing folsym()
authorFrank Terbeck <ft@grml.org>
Sat, 29 Dec 2007 11:24:49 +0000 (12:24 +0100)
committerFrank Terbeck <ft@grml.org>
Sat, 29 Dec 2007 11:24:49 +0000 (12:24 +0100)
...which was not exactly beautiful.
Just use ssl(), it does the same but looks clean.

Added copyright notice to the accept-line wrapper, because our zshrc
is GPL'd and the accept-line wrapper code is not.

etc/skel/.zshrc
etc/zsh/zshrc

index e722f76..6a0e30c 100644 (file)
@@ -604,39 +604,6 @@ show-archive() {
     fi
 }
 
-# TODO: isn't ssl() like this, but clean?
-#       I'd like to remove this, it's a gross hack, IMHO -ft
-#f5# Follow symlinks
-folsym() {
-    if [[ -e $1 || -h $1 ]] ; then
-        file=$1
-    else
-        file=`which $1`
-    fi
-    if [[ -e $file || -L $file ]] ; then
-        if [[ -L $file ]] ; then
-            echo `ls -ld $file | perl -ane 'print $F[7]'` '->'
-            folsym `perl -le '$file = $ARGV[0];
-                              $dest = readlink $file;
-                              if ($dest !~ m{^/}) {
-                                  $file =~ s{(/?)[^/]*$}{$1$dest};
-                              } else {
-                                  $file = $dest;
-                              }
-                              $file =~ s{/{2,}}{/}g;
-                              while ($file =~ s{[^/]+/\.\./}{}) {
-                                  ;
-                              }
-                              $file =~ s{^(/\.\.)+}{};
-                              print $file' $file`
-        else
-            ls -d $file
-        fi
-    else
-        echo $file
-    fi
-}
-
 # It's shameless stolen from <http://www.vim.org/tips/tip.php?tip_id=167>
 #f5# Use \kbd{vim} as your manpage reader
 vman() { man $* | col -b | view -c 'set ft=man nomod nolist' - }
index 028354c..89beb36 100644 (file)
@@ -422,6 +422,10 @@ bindkey '^Xi' insert-unicode-char
 #
 # For a broader description, see:
 # <http://bewatermyfriend.org/posts/2007/12-26.11-50-38-tooltime.html>
+#
+# The code is imported from the file 'zsh/functions/accept-line' from
+# <http://ft.bewatermyfriend.org/comp/zsh/zsh-dotfiles.tar.bz2>, which
+# distributed under the same terms as zsh itself.
 
 # A newly added command will may not be found or will cause false
 # correction attempts, if you got auto-correction set. By setting the