added findfile function
This commit is contained in:
parent
a262841172
commit
7bb3c1e96e
1 changed files with 19 additions and 6 deletions
|
@ -24,22 +24,22 @@ function prev() {
|
|||
}
|
||||
|
||||
# select from pet snippets
|
||||
function pet-select() {
|
||||
function petselect() {
|
||||
BUFFER=$(pet search --query "$LBUFFER")
|
||||
CURSOR=$#BUFFER
|
||||
zle redisplay
|
||||
}
|
||||
zle -N pet-select
|
||||
bindkey '^s' pet-select
|
||||
zle -N petselect
|
||||
bindkey '^s' petselect
|
||||
|
||||
# ranger as cli file manager
|
||||
run_ranger () {
|
||||
function runranger() {
|
||||
echo
|
||||
ranger < $TTY
|
||||
zle redisplay
|
||||
}
|
||||
zle -N run_ranger
|
||||
bindkey '^f' run_ranger
|
||||
zle -N runranger
|
||||
bindkey '^f' runranger
|
||||
|
||||
function ss() {
|
||||
command grc --colour=auto ss "$@"
|
||||
|
@ -48,3 +48,16 @@ function ss() {
|
|||
function gi() {
|
||||
curl -sLw "\n" "https://www.toptal.com/developers/gitignore/api/$@"
|
||||
}
|
||||
|
||||
function findfile() {
|
||||
local search
|
||||
if test "$1" = "--update"; then
|
||||
sudo updatedb
|
||||
shift
|
||||
search=$1
|
||||
else
|
||||
search=$1
|
||||
fi
|
||||
|
||||
locate "$PWD*$search*"
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue