Skip to content

Instantly share code, notes, and snippets.

@SeanHeelan
Created February 29, 2020 19:13
Show Gist options
  • Save SeanHeelan/499c7359de9fb7570cba31c20277e951 to your computer and use it in GitHub Desktop.
Save SeanHeelan/499c7359de9fb7570cba31c20277e951 to your computer and use it in GitHub Desktop.
Shell mark and jump to directories
export MARKPATH=$HOME/.marks
function jump {
cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
}
function mark {
mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$1"
}
function unmark {
rm -i "$MARKPATH/$1"
}
function marks {
ls -l "$MARKPATH" | sed 's/ / /g' | cut -d' ' -f9- | sed 's/ -/\t-/g' && echo
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment