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
86542dcd
Commit
86542dcd
authored
Sep 04, 2018
by
Maxime Brunet
Committed by
Marc Cornellà
Sep 04, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add fzf plugin (#6910)
parent
69e637c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
0 deletions
+69
-0
README.md
plugins/fzf/README.md
+19
-0
fzf.plugin.zsh
plugins/fzf/fzf.plugin.zsh
+50
-0
No files found.
plugins/fzf/README.md
0 → 100644
View file @
86542dcd
# fzf
This plugin enables
[
junegunn's fzf
](
https://github.com/junegunn/fzf
)
fuzzy auto-completion and key bindings
```
zsh
# Set fzf installation directory path
export
FZF_BASE
=
/path/to/fzf/install/dir
# Uncomment the following line to disable fuzzy completion
# export 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
)
```
plugins/fzf/fzf.plugin.zsh
0 → 100644
View file @
86542dcd
test
-d
"
${
FZF_BASE
}
"
&&
fzf_base
=
"
${
FZF_BASE
}
"
if
[[
-z
"
${
fzf_base
}
"
]]
;
then
fzfdirs
=(
"
${
HOME
}
/.fzf"
"/usr/local/opt/fzf"
"/usr/share/fzf"
)
for
dir
in
${
fzfdirs
}
;
do
if
[[
-d
"
${
dir
}
"
]]
;
then
fzf_base
=
"
${
dir
}
"
break
fi
done
if
[[
-z
"
${
fzf_base
}
"
]]
;
then
if
((
${
+commands[brew]
}
))
&&
dir
=
"
$(
brew
--prefix
fzf 2>/dev/null
)
"
;
then
if
[[
-d
"
${
dir
}
"
]]
;
then
fzf_base
=
"
${
dir
}
"
fi
fi
fi
fi
if
[[
-n
"
${
fzf_base
}
"
]]
;
then
# Setup fzf
# ---------
if
[[
!
"
$PATH
"
==
*
$fzf_base
/bin
*
]]
;
then
export
PATH
=
"
$PATH
:
$fzf_base
/bin"
fi
# Auto-completion
# ---------------
if
[[
!
"
$DISABLE_FZF_AUTO_COMPLETION
"
==
"true"
]]
;
then
[[
$-
==
*
i
*
]]
&&
source
"
$fzf_base
/shell/completion.zsh"
2> /dev/null
fi
# Key bindings
# ------------
if
[[
!
"
$DISABLE_FZF_KEY_BINDINGS
"
==
"true"
]]
;
then
source
"
$fzf_base
/shell/key-bindings.zsh"
fi
else
print
"[oh-my-zsh] fzf plugin: Cannot find fzf installation directory.
\n
"
\
"Please add
\`
export FZF_BASE=/path/to/fzf/install/dir
\`
to your .zshrc"
>
&2
fi
unset
fzf_base
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