mirror of
https://github.com/sbrl/bin.git
synced 2018-01-10 21:33:46 +00:00
Add telepick
This commit is contained in:
parent
7cf0213dda
commit
afe2afd09b
1 changed files with 6 additions and 1 deletions
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue