fzf: add check for OpenSUSE and OpenBSD packages (#9327)

This commit is contained in:
Marc Cornellà 2020-10-20 23:48:59 +02:00 committed by GitHub
commit 7d73908223
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 131 additions and 59 deletions

View file

@ -1,33 +1,52 @@
# fzf
This plugin enables [junegunn's fzf](https://github.com/junegunn/fzf) fuzzy auto-completion and key bindings
This plugin tries to find [junegunn's fzf](https://github.com/junegunn/fzf) based on where
it's been installed, and enables its fuzzy auto-completion and key bindings.
To use it, add `fzf` to the plugins array in your zshrc file:
```zsh
plugins=(... fzf)
```
## Settings
Add these before the `plugins=()` line in your zshrc file:
All these settings should go in your zshrc file, before Oh My Zsh is sourced.
### `FZF_BASE`
Set to fzf installation directory path:
```zsh
# Set fzf installation directory path
# export FZF_BASE=/path/to/fzf/install/dir
# Uncomment to set the FZF_DEFAULT_COMMAND
# export FZF_DEFAULT_COMMAND='<your fzf default commmand>'
# Uncomment the following line to disable fuzzy completion
# DISABLE_FZF_AUTO_COMPLETION="true"
# Uncomment the following line to disable key bindings (CTRL-T, CTRL-R, ALT-C)
# DISABLE_FZF_KEY_BINDINGS="true"
export FZF_BASE=/path/to/fzf/install/dir
```
| Setting | Example value | Description |
|-----------------------------|----------------------------|-------------------------------------------------------------|
| FZF_BASE | `/path/to/fzf/install/dir` | Set fzf installation directory path (**export**) |
| FZF_DEFAULT_COMMAND | `fd --type f` | Set default command to use when input is tty (**export**) |
| DISABLE_FZF_AUTO_COMPLETION | `true` | Set whether to load fzf auto-completion |
| DISABLE_FZF_KEY_BINDINGS | `true` | Set whether to disable key bindings (CTRL-T, CTRL-R, ALT-C) |
### `FZF_DEFAULT_COMMAND`
Set default command to use when input is tty:
```zsh
export FZF_DEFAULT_COMMAND='<your fzf default commmand>'
```
If not set, the plugin will try to set it to these, in the order in which they're found:
- [`rg`](https://github.com/BurntSushi/ripgrep)
- [`fd`](https://github.com/sharkdp/fd)
- [`ag`](https://github.com/ggreer/the_silver_searcher)
### `DISABLE_FZF_AUTO_COMPLETION`
Set whether to load fzf auto-completion:
```zsh
DISABLE_FZF_AUTO_COMPLETION="true"
```
### `DISABLE_FZF_KEY_BINDINGS`
Set whether to disable key bindings (CTRL-T, CTRL-R, ALT-C):
```zsh
DISABLE_FZF_KEY_BINDINGS="true"
```