mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-19 20:29:45 +01:00
Add tab completion for jump plugin
This commit is contained in:
parent
e368bf1d4a
commit
73c22c146c
1 changed files with 11 additions and 4 deletions
|
@ -8,14 +8,21 @@
|
|||
#
|
||||
export MARKPATH=$HOME/.marks
|
||||
function jump {
|
||||
cd -P $MARKPATH/$1 2>/dev/null || echo "No such mark: $1"
|
||||
cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
|
||||
}
|
||||
function mark {
|
||||
mkdir -p $MARKPATH; ln -s $(pwd) $MARKPATH/$1
|
||||
mkdir -p "$MARKPATH"; ln -s "$(pwd)" $MARKPATH/$1
|
||||
}
|
||||
function unmark {
|
||||
rm -i $MARKPATH/$1
|
||||
rm -i "$MARKPATH/$1"
|
||||
}
|
||||
function marks {
|
||||
ls -l $MARKPATH | sed 's/ / /g' | cut -d' ' -f9- | sed 's/ -/\t-/g' && echo
|
||||
ls -l "$MARKPATH" | sed 's/ / /g' | cut -d' ' -f9- | sed 's/ -/\t-/g' && echo
|
||||
}
|
||||
|
||||
function _completemarks {
|
||||
reply=($(ls $MARKPATH))
|
||||
}
|
||||
|
||||
compctl -K _completemarks jump
|
||||
compctl -K _completemarks unmark
|
||||
|
|
Loading…
Reference in a new issue