Skip to content

Commit

Permalink
Mark function asks for confirmation and uses basename of directory wh…
Browse files Browse the repository at this point in the history
…en no argument is given
  • Loading branch information
Jeroen Janssens committed Sep 6, 2013
1 parent 55d4873 commit 255b0c4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion plugins/jump/jump.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ jump() {
}

mark() {
mkdir -p "$MARKPATH"; ln -s "$(pwd)" $MARKPATH/$1
DIR="$(pwd)"
if (( $# == 0 )); then
MARK=$(basename $DIR)
else
MARK=$1
fi
if read -q \?"Mark ${DIR} as ${MARK}? (y/n) "; then
mkdir -p "$MARKPATH"; ln -s "${DIR}" "$MARKPATH/$MARK"
fi
}

unmark() {
Expand Down

0 comments on commit 255b0c4

Please sign in to comment.