junegunn/fzf
Vim plugin
plugin/fzf.vim is a self-contained Vim/Neovim plugin that ships in the same repository as the binary. It exposes the :FZF command and the fzf#run/fzf#wrap API. The plugin is intentionally a thin wrapper — most of the user-friendly Vim integrations (file finders, git pickers, etc.) live in the separate junegunn/fzf.vim plugin.
What ships here vs. there
This repository (junegunn/fzf):
plugin/fzf.vim— the runtime plugin: command, dispatch, andfzf#run.man/man1/fzf.1— referenced by:help fzf.- The README under "Vim plugin" links to install instructions.
The companion junegunn/fzf.vim repository:
- Pre-built commands like
:Files,:GFiles,:Buffers,:Lines,:Rg,:Commits, etc. - A small DSL for users to define their own pickers.
If you're working on the core, you only need the plugin in this repo.
Installing
The README documents the standard vim-plug recipe:
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }fzf#install() is defined in plugin/fzf.vim and downloads the matching binary if you didn't install via package manager.
:FZF
:FZF " files under cwd
:FZF ~/Code " files under a specific directory
:FZF -m " multi-select mode
:FZF -m --preview cat\ {} " arbitrary fzf args after the pathInternally :FZF calls fzf#run(fzf#wrap({...})). The wrap step:
- Inherits user defaults from
g:fzf_action,g:fzf_layout,g:fzf_history_dir,g:fzf_colors,g:fzf_buffers_jump. - Sets the source command (
$FZF_DEFAULT_COMMANDor the walker). - Picks a sink — by default,
e(open in current window). Map keys tos,v,t(split / vsplit / tab) viag:fzf_action.
fzf#run handles three execution modes:
- Neovim with
g:fzf_layoutset to a buffer — usestermopen()for an in-buffer terminal. - Vim 8+ with
+terminal— usesterm_start(). - Otherwise — falls back to
:!fzf ...and reads the result from a temp file.
The plugin also handles split/popup placement via g:fzf_layout, e.g. {'down': '40%'}, {'window': 'enew'}, or {'window': {'width': 0.9, 'height': 0.6}} for a Neovim/Vim popup.
fzf#run API
fzf#run({spec}) is the low-level entry point. The spec dictionary supports:
| Key | Purpose |
|---|---|
source |
A list, a shell command string, or a Funcref. |
sink |
A command name (e, tabnew, ...) or a Funcref called with each picked line. |
sinklist / sink* |
Like sink, but called once with the full list of picks. |
options |
Extra fzf flags (string or list). |
dir |
Working directory. |
up / down / left / right |
Open in a split with the given size. |
window |
Open in a popup or floating window. |
tmux |
Open via fzf-tmux (if available). |
Wrap your spec with fzf#wrap to inherit the user's g:fzf_* defaults and to enable the multi-action map (g:fzf_action).
Tests
test/vim/ contains a small Vim test (driven by Vader or similar). The tests are minimal because the plugin's main behavior is end-to-end: launch fzf, press a key, check that the buffer contains the expected text. The CI workflow installs Vim/Neovim and runs them.
Where it lives
| Concern | File |
|---|---|
| Plugin source | plugin/fzf.vim |
| Help text | man/man1/fzf.1 (Vim references this via :help fzf) |
| Tests | test/vim/ |
Related
- Higher-level pickers:
https://github.com/junegunn/fzf.vim(separate repo). - The Lua-flavored Neovim community has additional wrappers (e.g.,
fzf-lua,telescope.nvim); these live outside the fzf project.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.