1
0
Fork 0
mirror of https://github.com/sbrl/bin.git synced 2018-01-10 21:33:46 +00:00

Add telepick

This commit is contained in:
Starbeamrainbowlabs 2017-11-17 23:07:36 +00:00
parent 7cf0213dda
commit afe2afd09b

View file

@ -88,8 +88,13 @@ function man() { _colorman man "$@"; }
# Quickly jump around places # Quickly jump around places
function telepeek() { 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() { function teleport() {
cd $(find . -type d 2>/dev/null | grep -m1 -iP "$1"); 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");
}