all repos — dotfiles @ 80e2a806c30ffd3e1f61d032c2276e4e86583f04

my *nix dotfiles

ksh/.kshrc.d/30-marks.ksh (view raw)

 1export MARKPATH=$HOME/.marks
 2
 3function mark {
 4  mkdir -p "$MARKPATH"; ln -s "$PWD" "$MARKPATH/$1"
 5}
 6
 7function unmark {
 8    rm -i "$MARKPATH/"$(basename $PWD)""
 9}
10
11function marks {
12    for f in "$MARKPATH"/*; do
13        printf '%s → %s\n' "$(basename "$f")" "$(readlink "$f")"
14    done
15}
16
17function j {
18  cd -P "$MARKPATH/$1" 2>/dev/null || printf '%s\n' "error: no such mark $1"
19}