mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
Mark function asks for confirmation and uses basename of directory when no argument is given
This commit is contained in:
parent
838557a292
commit
ea3a851bc2
1 changed files with 9 additions and 1 deletions
|
|
@ -13,7 +13,15 @@ jump() {
|
||||||
}
|
}
|
||||||
|
|
||||||
mark() {
|
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() {
|
unmark() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue