(bash) add fn to open files/dirs easier with nvim
use the fuzzy powers!
This commit is contained in:
parent
c5d988241f
commit
217cf081d7
1 changed files with 15 additions and 0 deletions
|
|
@ -398,6 +398,21 @@ bc() {
|
||||||
bluetoothctl connect $mac
|
bluetoothctl connect $mac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# helper function to fuzzy search files in the current working directory
|
||||||
|
ed() {
|
||||||
|
local f=""
|
||||||
|
|
||||||
|
if [ $# -eq 1 ]; then
|
||||||
|
f=$(find . | grep -Ev "node_modules|\.git" | fzf --filter="$1" --select-1 --exit-0 | head -1)
|
||||||
|
else
|
||||||
|
f=$(find . | grep -Ev "node_modules|\.git" | fzf)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$f" ]; then
|
||||||
|
nvim "$f"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
export GOPATH=$HOME/go
|
export GOPATH=$HOME/go
|
||||||
export PATH=$PATH:$GOPATH:$GOPATH/bin
|
export PATH=$PATH:$GOPATH:$GOPATH/bin
|
||||||
export EDITOR=nvim
|
export EDITOR=nvim
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue