added findfile function

This commit is contained in:
eeleater 2024-10-04 01:46:37 +02:00
parent a262841172
commit 7bb3c1e96e

View file

@ -24,22 +24,22 @@ function prev() {
} }
# select from pet snippets # select from pet snippets
function pet-select() { function petselect() {
BUFFER=$(pet search --query "$LBUFFER") BUFFER=$(pet search --query "$LBUFFER")
CURSOR=$#BUFFER CURSOR=$#BUFFER
zle redisplay zle redisplay
} }
zle -N pet-select zle -N petselect
bindkey '^s' pet-select bindkey '^s' petselect
# ranger as cli file manager # ranger as cli file manager
run_ranger () { function runranger() {
echo echo
ranger < $TTY ranger < $TTY
zle redisplay zle redisplay
} }
zle -N run_ranger zle -N runranger
bindkey '^f' run_ranger bindkey '^f' runranger
function ss() { function ss() {
command grc --colour=auto ss "$@" command grc --colour=auto ss "$@"
@ -48,3 +48,16 @@ function ss() {
function gi() { function gi() {
curl -sLw "\n" "https://www.toptal.com/developers/gitignore/api/$@" 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*"
}