summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-09-22 07:10:52 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-09-22 07:10:52 +0200
commite8449fdf180c63e1f872cdbea46f942d348eb2b9 (patch)
tree5719d5542de139685975f6a1cfc28e0b29b6f0b2 /etc
parentfac1a17cafe72e31aede7236ed7716a7a168219d (diff)
Added anytag
Diffstat (limited to 'etc')
-rw-r--r--etc/function2
-rw-r--r--etc/functions/anytag19
2 files changed, 20 insertions, 1 deletions
diff --git a/etc/function b/etc/function
index 82f6677..60d6454 100644
--- a/etc/function
+++ b/etc/function
@@ -7,7 +7,7 @@ autoload catch throw
autoload zargs
# own functions
-autoload chpwd dirinfo extr plonkhost put reload rtab world-readable
+autoload anytag chpwd dirinfo extr plonkhost put reload rtab world-readable
autoload xexport xsource youtube-watch
colors
diff --git a/etc/functions/anytag b/etc/functions/anytag
new file mode 100644
index 0000000..0d3c090
--- /dev/null
+++ b/etc/functions/anytag
@@ -0,0 +1,19 @@
+## vim:ft=zsh
+## anytag - tag files based on symlinks (quick&dirty)
+
+typeset -T REPLY reply ' '
+typeset cmd=$1
+typeset file tag
+
+mkdir -p .tags
+for file in *(.); do
+ eval $cmd
+ read
+ for tag in $reply; do
+ mkdir -p tags/$tag
+ (
+ cd tags/$tag
+ ln -s ../../$file
+ )
+ done
+done