summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/function4
-rw-r--r--etc/functions/chpwd8
-rw-r--r--etc/functions/dirinfo21
3 files changed, 24 insertions, 9 deletions
diff --git a/etc/function b/etc/function
index 8ea4f45..82f6677 100644
--- a/etc/function
+++ b/etc/function
@@ -7,8 +7,8 @@ autoload catch throw
autoload zargs
# own functions
-autoload chpwd extr plonkhost put reload rtab world-readable youtube-watch
-autoload xexport xsource
+autoload chpwd dirinfo extr plonkhost put reload rtab world-readable
+autoload xexport xsource youtube-watch
colors
chpwd
diff --git a/etc/functions/chpwd b/etc/functions/chpwd
index cf71865..bf8b4d9 100644
--- a/etc/functions/chpwd
+++ b/etc/functions/chpwd
@@ -1,10 +1,4 @@
## vim:ft=zsh
-psvar[1]=''
-[[ -f .todo ]] && psvar[1]+='todo '
-[[ -f .fehindex.jpg ]] && psvar[1]+='feh '
-[[ -d .hg ]] && psvar[1]+='hg '
-[[ -d .git ]] && psvar[1]+='git '
-[[ -d .svn ]] && psvar[1]+='svn '
-[[ -f Makefile || -f makefile ]] && psvar[1]+='make '
+psvar[1]=$(dirinfo)
psvar[2]=$(rtab -f)
diff --git a/etc/functions/dirinfo b/etc/functions/dirinfo
new file mode 100644
index 0000000..eb4fda3
--- /dev/null
+++ b/etc/functions/dirinfo
@@ -0,0 +1,21 @@
+## vim:ft=zsh
+## Collect some directory information for the prompt
+## Written 2008 by Daniel Friesel <derf@derf.homelinux.org>
+##
+
+typeset string
+
+if [[ -r .todo ]] {
+ if [[ ${#$(todo)} -gt 0 ]] {
+ string+='todo* '
+ } else {
+ string+='todo '
+ }
+}
+[[ -f .fehindex.jpg ]] && string+='feh '
+[[ -d .hg ]] && string+='hg '
+[[ -d .git ]] && string+='git '
+[[ -d .svn ]] && string+='svn '
+[[ -f Makefile || -f makefile ]] && string+='make '
+
+echo $string