This commit is contained in:
hqingyi 2017-05-09 11:24:10 +00:00 committed by GitHub
commit a624a3f16b
4 changed files with 235 additions and 8 deletions

View file

@ -28,7 +28,7 @@ unmark() {
}
marks() {
for link in $MARKPATH/*(@); do
for link in $MARKPATH/@(*|.*)(@); do
local markname="$fg[cyan]${link:t}$reset_color"
local markpath="$fg[blue]$(readlink $link)$reset_color"
printf "%s\t" $markname
@ -37,13 +37,7 @@ marks() {
}
_completemarks() {
if [[ $(ls "${MARKPATH}" | wc -l) -gt 1 ]]; then
reply=($(ls $MARKPATH/**/*(-) | grep : | sed -E 's/(.*)\/([_a-zA-Z0-9\.\-]*):$/\2/g'))
else
if readlink -e "${MARKPATH}"/* &>/dev/null; then
reply=($(ls "${MARKPATH}"))
fi
fi
reply=($(find $MARKPATH -type l | sed -E 's/(.*)\/([_a-zA-Z0-9\.\-]*)$/\2/g'))
}
compctl -K _completemarks jump
compctl -K _completemarks unmark