| Server IP : 199.250.200.62 / Your IP : 216.73.217.89 Web Server : Apache System : Linux vps37394.inmotionhosting.com 3.10.0-1160.119.1.vz7.224.4 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64 User : jasonp18 ( 1000) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /usr/share/zsh/5.0.2/functions/ |
Upload File : |
# With arguments, output those files to the recent directory file.
# With no arguments, read in the directories from the file into $reply.
#
# Handles recent-dirs-file and recent-dirs-max styles.
emulate -L zsh
setopt extendedglob
integer max
local file line
local -a files dir
local default=${ZDOTDIR:-$HOME}/.chpwd-recent-dirs
if zstyle -a ':chpwd:' recent-dirs-file files; then
files=(${files//(#s)+(#e)/$default})
fi
if (( ${#files} == 0 )); then
files=($default)
fi
zstyle -s ':chpwd:' recent-dirs-max max || max=20
if (( $# )); then
if (( max > 0 && ${#argv} > max )); then
argv=(${argv[1,max]})
fi
# Quote on write.
# Use $'...' quoting... this fixes newlines and other nastiness.
print -rl ${(qqqq)argv} >${files[1]}
else
typeset -g reply
# Unquote on read.
reply=()
for file in $files; do
[[ -r $file ]] || continue
# Strip anything after the directory from the line.
# At the moment there isn't anything, but we'll make this
# future proof.
for line in ${(f)"$(<$file)"}; do
dir=(${(z)line})
reply+=(${(Q)${dir[1]}})
if (( max > 0 && ${#reply} == max )); then
break 2
fi
done
done
fi