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
|
# 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*"
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue