This document does not yet contain all of fzf-lua's options, there are a lot of esoteric and undocumented options which can be found in issues/discussions which I will slowly but surely add to this document.
Options in fzf-lua can be specified in a few different ways:
- Global setup options
- Provider-defaults setup options
- Provider-specific setup options
- Command call options
Most of fzf-lua's options are applicable in all of the above, a few examples below:
Global setup, applies to all fzf-lua interfaces:
-- Places the floating window at the bottom left corner
require("fzf-lua").setup({ winopts = { row = 1, col = 0 } })
Disable file_icons
globally (files, grep, etc) via provider defaults setup options:
require("fzf-lua").setup({ defaults = { file_icons = false } })
Disable file_icons
in files
only via provider specific setup options:
require("fzf-lua").setup({ files = { file_icons = false } })
Disable file_icons
in files
, applies to this call only:
:lua require("fzf-lua").files({ file_icons = false })
-- Or
:FzfLua files file_icons=false
Fzf-lua conveniently enables setting lua tables recursively using dotted keys, for example, if we
wanted to call files
in "split" mode (instead of the default floating window), we would normally call:
:lua require("fzf-lua").files({ winopts = { split = "belowright new" } })
But we can also use the dotted key format (unique to fzf-lua):
:lua require("fzf-lua").files({ ["winopts.split"] = "belowright new" })
This makes it possible to send nested lua values via the :FzfLua
user command:
-- Escape spaces with \
:FzfLua files winopts.split=belowright\ new
Lua string serialization is also possible:
-- Places the floating window at the top left corner
:FzfLua files winopts={row=0,col=0}
Most of fzf-lua's options are global, meaning they can be specified in any of the different ways explained in General Usage and are described in detail in the Global Options section below.
There are however a few options that can be specified only during the call to setup
, these are
described below.
Type: string
, Default: nil
Fzf-lua uses a special invisible unicode character EN SPACE
(U+2002) as text delimiter.
It is not recommended to modify this value as this can have uninteded consequnces when entries contain the character designated as nbsp
, but if your terminal/font does not support EN_SPACE
you can use NBSP
(U+00A0) instead:
require("fzf-lua").setup({ nbsp = "\xc2\xa0" })
Type: string|function|object
, Default: builtin
Default previewer for file pickers, possible values builtin|bat|cat|head
, for example:
require("fzf-lua").setup({ winopts = { preview = { default = "bat" } } })
If set to a function
the return value will be used (string|object
).
If set to an object
, fzf-lua expects a previewer class that will be initlaized with object:new(...)
, see the advanced Wiki "Neovim builtin previewer" section for more info.
Type: fun(number, boolean, table)
, Default: vim.api.nvim_open_win
Function override for opening the help window (default bound to <F1>
), will be called with the same arguments as nvim_open_win(bufnr, enter, winopts)
. By default opens a floating window at the bottom of current screen.
Override this function if you want to customize window configs of the help window (location, width, border, etc.).
Example, opening a floating help window at the top of screen with single border:
require("fzf-lua").setup({
help_open_win = function(buf, enter, opts)
opts.border = 'single'
opts.row = 0
opts.col = 0
return vim.api.nvim_open_win(buf, enter, opts)
end,
})
Globals are options that aren't picker-specific and can be used with all fzf-lua commands, for
example, positioning the floating window at the bottom line using globals.winopts.row
:
The
globals
prefix denotates the scope of the option and is therefore omitted
Using FzfLua
user command:
:FzfLua files winopts.row=1
Using Lua:
:lua require("fzf-lua").files({ winopts = { row = 1 } })
-- Using the recursive option format
:lua require("fzf-lua").files({ ["winopts.row"] = 1 })
Type: string
, Default: nil
Sets the current working directory.
Type: string
, Default: nil
Initial query (prompt text), passed to fzf as --query
flag.
Type: string
, Default: nil
Fzf prompt, passed to fzf as --prompt
flag.
Type: string|false
, Default: nil
Header line, set to any string to display a header line, set to false
to disable fzf-lua
interactive headers (e.g. "ctrl-g to disable .gitignore", etc), passed to fzf as --header
flag.
Type: string
, Default: nil
Previewer override, set to false
to disable the previewer.
By default files pickers use the "builtin" previewer, possible values for file pickers bat|cat|head
.
Other overrides include:
:FzfLua helptags previewer=help_native
:FzfLua manpages previewer=man_native
Type: string
, Default: nil
Custom path formatter, can be defined under setup.formatters
, fzf-lua comes with a builtin vscode-like formatter, displaying the filename first followed by the folder.
Try it out with:
:FzfLua files formatter=path.filename_first
:FzfLua live_grep formatter=path.filename_first
Or via setup
for permanency:
require("fzf-lua").setup({ files = { formatter = "path.filename_first" } })
Type: boolean|string
, Default: true
If available, display file icons.
Set to true
will attempt to use "nvim-web-devicons" and fallback to "mini.icons", other possible
values are devicons
or mini
which force loading a specific icons plugin, for example:
:FzfLua files file_icons=mini
:lua require("fzf-lua").files({ file_icons = "devicons" })
Type: boolean
, Default: true
If inside a git-repo add git status indicator icons e.g. M
for modified files.
Type: boolean
, Default: true
Add coloring of file|git icons.
Type: string
, Default: nil
Neovim split command to use for fzf-lua interface, e.g belowright new
.
Type: number
, Default: 0.55
Screen column where to place the fzf-lua float window, between 0-1 will represent percentage of vim.o.columns
(0: leftmost, 1: rightmost), if >= 1 will attempt to place the float in the exact screen column.
Type: number
, Default: 0.35
Screen row where to place the fzf-lua float window, between 0-1 will represent percentage of vim.o.lines
(0: top, 1: bottom), if >= 1 will attempt to place the float in the exact screen line.
Type: number
, Default: 0.80
Width of the fzf-lua float, between 0-1 will represent percentage of vim.o.columns
(1: max width), if >= 1 will use fixed number of columns.
Type: number
, Default: 0.85
Height of the fzf-lua float, between 0-1 will represent percentage of vim.o.lines
(1: max height), if >= 1 will use fixed number of lines.
Type: string|table
, Default: rounded
Border of the fzf-lua float, possible values are none|single|double|rounded|thicc|thiccc|thicccc
or a custom border character array passed as is to nvim_open_win
.
Type: boolean|number
, Default: 60
Backdrop opacity value, 0 for fully opaque, 100 for fully transparent (i.e. disabled).
Type: boolean
, Default: false
Use fullscreen for the fzf-load floating window.
Type: boolean
, Default: false
Use treesitter highlighting in fzf's main window.
NOTE: Only works for file-like entires where treesitter parser exists and is loaded for the filetype.
Type: function
, Default: nil
Callback after the creation of the fzf-lua main terminal window.
Type: number
, Default: 20
Debounce time (milliseconds) for displaying the preview buffer in the builtin previewer.
Type: string
, Default: nowrap
Line wrap in both native fzf and the builtin previewer, mapped to fzf's --preview-window:[no]wrap
flag.
globals.winopts.preview.hidden
Type: string
, Default: nohidden
Preview startup visibility in both native fzf and the builtin previewer, mapped to fzf's --preview-window:[no]hidden
flag.
NOTE: this is different than setting
previewer=false
which disables the previewer altogether with no toggle ability.
Type: string
, Default: border
Preview border for native fzf previewers (i.e. bat
, git_status
), set to noborder
to hide the preview border, consult man fzf
for all available options.
Type: string
, Default: flex
Preview layout, possible values are horizontal|vertical|flex
, when set to flex
fzf window
width is tested against winopts.preview.flip_columns
, when <= vertical
is used, otherwise
horizontal
.
Type: number
, Default: 100
Auto-detect the preview layout based on available width, see above note in winopts.preview.layout
.
Type: string
, Default: right:60%
Horizontal preview layout, mapped to fzf's --preview-window:...
flag.
*Requires winopts.preview.layout={horizontal|flex}
Type: string
, Default: down:45%
Vertical preview layout, mapped to fzf's --preview-window:...
flag.
*Requires winopts.preview.layout={vertical|flex}
Type: boolean
, Default: true
Controls title display in the builtin previewer.
Type: string
, Default: center
Controls title display in the builtin previewer, possible values are left|right|center
.
Type: string|boolean
, Default: float
Scrollbar style in the builtin previewer, set to false
to disable, possible values are
float|border
.
Type: number
, Default: -2
Float style scrollbar offset from the right edge of the preview window.
*Requires winopts.preview.scrollbar=float
Type: boolean
, Default: true
Builtin previewer buffer local option, see :help 'number'
.
Type: boolean
, Default: false
Builtin previewer buffer local option, see :help 'relativenumber'
.
Type: boolean
, Default: true
Builtin previewer buffer local option, see :help 'cursorline'
.
Type: boolean
, Default: false
Builtin previewer buffer local option, see :help 'cursorcolumn'
.
Type: string
, Default: both
Builtin previewer buffer local option, see :help 'cursorlineopt'
.
Type: string
, Default: no
Builtin previewer buffer local option, see :help 'signcolumn'
.
Type: boolean
, Default: false
Builtin previewer buffer local option, see :help 'list'
.
Type: boolean
, Default: false
Builtin previewer buffer local option, see :help 'foldenable'
.
Type: string
, Default: manual
Builtin previewer buffer local option, see :help 'foldmethod'
.
Type: number
, Default: 1
Builtin previewer buffer local option, see :help 'scrolloff'
.
Type: string
, Default: FzfLuaNormal
Main fzf (terminal) window normal (text/bg) highlight group.
Type: string
, Default: FzfLuaBorder
Main fzf (terminal) window border highlight group.
Type: string
, Default: FzfLuaTitle
Main fzf (terminal) window title highlight group.
Type: string
, Default: FzfLuaBackdrop
Backdrop color, black by default, used to darken the background color when opening the UI.
Type: string
, Default: FzfLuaPreviewNormal
Builtin previewer window normal (text/bg) highlight group.
Type: string
, Default: FzfLuaPreviewBorder
Builtin previewer window border highlight group.
Type: string
, Default: FzfLuaPreviewTitle
Builtin previewer window title highlight group.
Type: string
, Default: FzfLuaCursor
Builtin previewer window Cursor
highlight group.
Type: string
, Default: FzfLuaCursorLine
Builtin previewer window CursorLine
highlight group.
Type: string
, Default: FzfLuaCursorLineNr
Builtin previewer window CursorLineNr
highlight group.
Type: string
, Default: FzfLuaSearch
Builtin previewer window search matches highlight group.
Type: string
, Default: FzfLuaScrollBorderEmpty
Builtin previewer window border
scrollbar empty highlight group.
Type: string
, Default: FzfLuaScrollBorderFull
Builtin previewer window border
scrollbar full highlight group.
Type: string
, Default: FzfLuaScrollFloatEmpty
Builtin previewer window float
scrollbar empty highlight group.
Type: string
, Default: FzfLuaScrollFloatFull
Builtin previewer window float
scrollbar full highlight group.
Type: string
, Default: FzfLuaHelpNormal
Help window (F1) normal (text/bg) highlight group.
Type: string
, Default: FzfLuaHelpBorder
Help window (F1) border highlight group.
Type: string
, Default: FzfLuaHeaderBind
Interactive headers keybind highlight group, e.g. <ctrl-g> to Disable .gitignore
.
Type: string
, Default: FzfLuaHeaderText
Interactive headers description highlight group, e.g. <ctrl-g> to Disable .gitignore
.
Type: string
, Default: FzfLuaPathLineNr
Highlight group for the line part of paths, e.g. file:<line>:<col>:
, used in pickers such as buffers
, quickfix
, lsp
, diagnostics
, etc.
Type: string
, Default: FzfLuaPathColNr
Highlight group for the column part of paths, e.g. file:<line>:<col>:
, used in pickers such as buffers
, quickfix
, lsp
, diagnostics
, etc.
Type: string
, Default: FzfLuaBufName
Highlight group for buffer name (filepath) in lines
.
Type: string
, Default: FzfLuaBufId
Highlight group for buffer id (number) in lines
.
Type: string
, Default: FzfLuaBufNr
Highlight group for buffer number in buffers
, tabs
.
Type: string
, Default: FzfLuaBufLineNr
Highlight group for buffer line number in lines
, blines
and treesitter
.
Type: string
, Default: FzfLuaBufFlagCur
Highlight group for the current buffer flag in buffers
, tabs
.
Type: string
, Default: FzfLuaBufFlagAlt
Highlight group for the alternate buffer flag in buffers
, tabs
.
Type: string
, Default: FzfLuaTabTitle
Highlight group for the tab title in tabs
.
Type: string
, Default: FzfLuaTabMarker
Highlight group for the current tab marker in tabs
.
Type: string
, Default: FzfLuaDirIcon
Highlight group for the directory icon in paths that end with a separator, usually used in path
completion, e.g. complete_path
.
Type: string
, Default: FzfLuaDirPart
Highlight group for the directory part when using path.dirname_first
or path.filename_first
formatters.
Type: string
, Default: FzfLuaFilePart
Highlight group for the directory part when using path.dirname_first
or path.filename_first
formatters.
Type: string
, Default: FzfLuaLiveSym
Highlight group for the matched characters in lsp_live_workspace_symbols
.
Type: string
, Default: FzfLuaFzfNormal
Highlight group for fzf's fg
and bg
, by default links to FzfLuaNormal
.
Type: string
, Default: FzfLuaFzfCursorLine
Highlight group for fzf's fg+
and bg+
, by default links to FzfLuaCursorLine
.
Type: string
, Default: FzfLuaFzfMatch
Highlight group for fzf's hl+
, by default links to Special
.
Type: string
, Default: FzfLuaFzfBorder
Highlight group for fzf's border
, by default links to FzfLuaBorder
.
Type: string
, Default: FzfLuaFzfScrollbar
Highlight group for fzf's border
, by default links to FzfLuaFzfBorder
.
Type: string
, Default: FzfLuaFzfSeparator
Highlight group for fzf's separator
, by default links to FzfLuaFzfBorder
.
Type: string
, Default: FzfLuaFzfGutter
Highlight group for fzf's gutter
, by default links to FzfLuaFzfBorder
.
NOTE:
bg
property of the highlight group will be used.
Type: string
, Default: FzfLuaFzfHeader
Highlight group for fzf's header
, by default links to FzfLuaTitle
.
Type: string
, Default: FzfLuaFzfInfo
Highlight group for fzf's info
, by default links to NonText
.
Type: string
, Default: FzfLuaFzfPointer
Highlight group for fzf's pointer
, by default links to Special
.
Type: string
, Default: FzfLuaFzfMarker
Highlight group for fzf's marker
, by default links to FzfLuaFzfPointer
.
Type: string
, Default: FzfLuaFzfSpinner
Highlight group for fzf's spinner
, by default links to FzfLuaFzfPointer
.
Type: string
, Default: FzfLuaFzfPrompt
Highlight group for fzf's prompt
, by default links to Special
.
Type: string
, Default: FzfLuaFzfQuery
Highlight group for fzf's query
, by default links to FzfLuaNormal
and
sets text to regular
(non-bold).
Open buffers
Open buffers in tabs
File history (output of :oldfiles
)
Quickfix list (output of :copen
)
Quickfix list history (output of :chistory
)
Location list (output of :lopen
)
Location list history (output of :lhistory
)
Current buffer treesitter symbols
Current buffer lines
Open buffers lines
Neovim's argument list (output of :args
)
Type: boolean
, Default: true
Exclude non-file entries (directories).
Files finder, will enumerate the filesystem of the current working directory using fd
, rg
and grep
or dir.exe
.
Type: boolean
, Default: true
Display the current working directory in the prompt (fzf.vim
style).
Type: number
, Default: 32
Prompt over this length will be shortened, e.g. ~/.config/nvim/lua/
will be shortened to ~/.c/n/lua/
(for more info see :help pathshorten
).
*Requires cwd_prompt=true
Type: number
, Default: 1
Length of shortened prompt path parts, e.g. set to 2
, ~/.config/nvim/lua/
will be shortened to ~/.co/nv/lua/
(for more info see :help pathshorten
).
*Requires cwd_prompt=true
Search for strings/regexes using rg
, grep
or any other compatible grep'er binary (e.g. ag
).
Unless search=...
is specified will prompt for the search string.
Search for strings/regexes using rg
, grep
or any other compatible grep'er binary (e.g. ag
).
Unlike grep
which uses a fixed search string/regex each keypress generates a new underlying grep command with the prompt input text, this can be more performant on large monorepos to narrow down the result set before switching to fuzzy matching with ctrl-g
for further refinement.
Performant "live" grep variant piping the underlying command directly to fzf (without any processing by fzf-lua), disables all the bells and whistles (icons, path manipulation, etc).
"Live" grep variant with add support for rg --iglob
flag, use the default separator --
to specify globs, for example, pcall -- *.lua !*spec*
will search for pcall
in any lua file that doesn't contain spec
.
Alias to :FzfLua live_grep resume=true
Alias to :FzfLua grep search=""
, feeds all lines of the project into fzf for fuzzy matching.
NOTE: on large monorepos feeding all lines of the project into fzf isn't very efficient, consider using live_grep
first with a regex to narrow down the result set and then switch to fuzzy finding for further refinement by pressing ctrl-g
.
Alias to :FzfLua grep resume=true
Grep word/WORD under cursor
Grep visual selection
Grep on current buffer only
"Live" grep on current buffer only
Grep the quickfix list
"Live" grep the quickfix list
Grep the location list
"Live" grep the location list
Search project ctags
Search current buffer ctags
"Grep" for tags, see grep
for more info.
"Live-Grep" for tags, see live_grep
for more info.
Tags-Grep word/WORD under cursor
Tags-Grep visual selection
Git files
Git status
Git commits (project)
Git commits (buffer)
Git blame (buffer)
Git branches
Git tags
Git stashes
LSP references
LSP Definitions
LSP Declarations
LSP Type Definitions
LSP Implementations
LSP Document Symbols
LSP Workspace Symbols
LSP Workspace Symbols "live" query
LSP Incoming Calls
LSP Outgoing Calls
LSP Code Actions
All LSP locations, combined view
Document Diagnostics (alias to diagnostics_document
)
Workspace Diagnostics (alias to diagnostics_workspace
)
Document Diagnostics
Workspace Diagnostics
Type: number|boolean
, Default: 5000
Whether LSP calls are made block, set to true
for asynchronous, otherwise defines the timeout
(ms) for the LPS request via vim.lsp.buf_request_sync
.
Resume last command/query
fzf-lua builtin commands
Fzf-lua configuration profiles
Search Helptags
Search man pages
Installed colorschemes
"Awesome Neovim" colorschemes
Neovim's highlight groups
Neovim commands
Executed command history
Search history
Search :marks
Search :jumps
Search :changes
Search :registers
Search :tags
Neovim's autocmds
Neovims key mappings
Filetypes
Neovim's menus
Spelling suggestions
:packadd <package>
Setup/Reset fzf-lua highlight groups.
Setup fzf.vim
user commands mapped to their fzf-lua equivalents (e.g. :Files
, :Rg
, etc).
Register fzf-lua as the UI interface for vim.ui.select
De-register fzf-lua with vim.ui.select
DAP builtin commands
DAP configurations
DAP breakpoints
DAP active session variables
DAP active session jump to frame
Tmux paste buffers
Complete path under cursor (incl dirs)
Complete file under cursor (excl dirs)
Complete line (all open buffers)
Complete line (current buffer only)