Skip to content

Instantly share code, notes, and snippets.

@AndrewVos
Created January 14, 2014 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewVos/8416404 to your computer and use it in GitHub Desktop.
Save AndrewVos/8416404 to your computer and use it in GitHub Desktop.
# directory-jumper {
# http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-filesystem-from-the-command-line.html
export MARKPATH=$HOME/.marks
function j {
cd -P $MARKPATH/$1 2>/dev/null || echo "No such mark: $1"
}
function j-mark {
mkdir -p $MARKPATH; ln -s $(pwd) $MARKPATH/$1
}
function j-unmark {
rm -i $MARKPATH/$1
}
function marks {
ls -l $MARKPATH | sed 's/ / /g' | cut -d' ' -f9- | sed 's/ -/\t-/g' && echo
}
# https://news.ycombinator.com/item?id=6229468
function _marks {
reply=($(ls $MARKPATH))
}
compctl -K _marks j
compctl -K _marks j-unmark
# }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment