Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
708ea423
Unverified
Commit
708ea423
authored
Sep 04, 2020
by
Alessandro Martini
Committed by
GitHub
Sep 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fzf: setup FZF_DEFAULT_COMMAND based on installed tools (#8895)
Co-authored-by:
Marc Cornellà
<
marc.cornella@live.com
>
parent
415be382
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
8 deletions
+32
-8
README.md
plugins/fzf/README.md
+22
-8
fzf.plugin.zsh
plugins/fzf/fzf.plugin.zsh
+10
-0
No files found.
plugins/fzf/README.md
View file @
708ea423
...
...
@@ -2,18 +2,32 @@
This plugin enables
[
junegunn's fzf
](
https://github.com/junegunn/fzf
)
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:
```
zsh
# Set fzf installation directory path
export
FZF_BASE
=
/path/to/fzf/install/dir
# 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
#
export
DISABLE_FZF_AUTO_COMPLETION="true"
# DISABLE_FZF_AUTO_COMPLETION="true"
# Uncomment the following line to disable key bindings (CTRL-T, CTRL-R, ALT-C)
# export DISABLE_FZF_KEY_BINDINGS="true"
plugins
=(
...
fzf
)
# DISABLE_FZF_KEY_BINDINGS="true"
```
| 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) |
plugins/fzf/fzf.plugin.zsh
View file @
708ea423
...
...
@@ -98,3 +98,13 @@ function indicate_error() {
setup_using_debian_package
||
setup_using_base_dir
||
indicate_error
unset
-f
setup_using_debian_package setup_using_base_dir indicate_error
if
[[
-z
"
$FZF_DEFAULT_COMMAND
"
]]
;
then
if
((
$+
commands[rg]
))
;
then
export
FZF_DEFAULT_COMMAND
=
'rg --files --hidden'
elif
((
$+
commands[fd]
))
;
then
export
FZF_DEFAULT_COMMAND
=
'fd --type f --hidden --exclude .git'
elif
((
$+
commands[ag]
))
;
then
export
FZF_DEFAULT_COMMAND
=
'ag -l --hidden -g ""'
fi
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment