Update git ls-tree example (close #168)
This commit is contained in:
parent
8a4db3c004
commit
1c65139888
15
README.md
15
README.md
@ -423,18 +423,9 @@ If you're running fzf in a large git repository, `git ls-tree` can boost up the
|
|||||||
speed of the traversal.
|
speed of the traversal.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Copy the original fzf function to __fzf
|
export FZF_DEFAULT_COMMAND='
|
||||||
declare -f __fzf > /dev/null ||
|
(git ls-tree -r --name-only HEAD ||
|
||||||
eval "$(echo "__fzf() {"; declare -f fzf | \grep -v '^{' | tail -n +2)"
|
find * -name ".*" -prune -o -type f -print -o -type l -print) 2> /dev/null'
|
||||||
|
|
||||||
# Use git ls-tree when possible
|
|
||||||
fzf() {
|
|
||||||
if [ -n "$(git rev-parse HEAD 2> /dev/null)" ]; then
|
|
||||||
FZF_DEFAULT_COMMAND="git ls-tree -r --name-only HEAD" __fzf "$@"
|
|
||||||
else
|
|
||||||
__fzf "$@"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Using fzf with tmux panes
|
#### Using fzf with tmux panes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user