diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-11-16 20:03:31 +0100 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-11-16 20:03:31 +0100 |
commit | eaba08ca7ab2819a874ccc3d81bc6cb4cccbe379 (patch) | |
tree | e277c803145ae12204ffc4469f3cb2741cdbb8c0 /etc/functions | |
parent | 9e910dec14c0f8ac3d0cdef4220046c3c570b40c (diff) |
rtab function: Allow configuration via zstyle
Diffstat (limited to 'etc/functions')
-rw-r--r-- | etc/functions/chpwd | 2 | ||||
-rw-r--r-- | etc/functions/rtab | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/etc/functions/chpwd b/etc/functions/chpwd index 11510b4..40070b2 100644 --- a/etc/functions/chpwd +++ b/etc/functions/chpwd @@ -3,4 +3,4 @@ ## This all belongs into the prompt, but since it only changes ## when changing directories, it's more efficient to do it here psvar[1]=$(dirinfo) -psvar[2]=$(rtab -f) +psvar[2]=$(rtab) diff --git a/etc/functions/rtab b/etc/functions/rtab index b543493..ff4245e 100644 --- a/etc/functions/rtab +++ b/etc/functions/rtab @@ -13,6 +13,15 @@ typeset lastfull=0 typeset short=0 typeset tilde=0 +if zstyle -t ':prompt:rtab' fish; then + lastfull=1 + short=1 + tilde=1 +fi +zstyle -t ':prompt:rtab' last && lastfull=1 +zstyle -t ':prompt:rtab' short && short=1 +zstyle -t ':prompt:rtab' tilde && tilde=1 + while [[ $1 == -* ]]; do case $1 in -f|--fish) @@ -26,6 +35,8 @@ while [[ $1 == -* ]]; do print ' -l, --last Print the last directory''s full name' print ' -s, --short Truncate directory names to the first character' print ' -t, --tilde Print ~ for the home directory' + print 'The long options can also bu set via zstyle, like' + print ' zstyle :prompt:rtab fish yes' return 0 ;; -l|--last) lastfull=1 ;; |