1
0
Fork 0

Add telepick

This commit is contained in:
Starbeamrainbowlabs 2017-11-17 23:07:36 +00:00
parent 7cf0213dda
commit afe2afd09b
1 changed files with 6 additions and 1 deletions

View File

@ -88,8 +88,13 @@ function man() { _colorman man "$@"; }
# Quickly jump around places
function telepeek() {
find . -type d 2>/dev/null | grep -iP "$1" | less
find . -type d 2>/dev/null | grep -iP "$1" | cat -n | sed 's/^[ 0-9]*[0-9]/\o033[34m&\o033[0m/' | less -R
}
function teleport() {
cd $(find . -type d 2>/dev/null | grep -m1 -iP "$1");
}
function telepick() {
telepeek $1;
read -p "jump to index: " line_number;
cd $(find . -type d 2>/dev/null | grep -iP "$1" | sed "${line_number}q;d");
}