all repos — dotfiles @ 2358d59695ae67c6ff50342962b0af21b4e13b86

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}