A minimalistic fzf
plugin.
This project is heavily inspired by fzf.vim, but has a few differences:
- Pure Lua implementation
- Much smaller codebase
- Fewer dependencies and features
The only dependency is the configured basic fzf plugin that is usually installed with the fzf
package. You can use the following command to check that the basic plugin works:
:call fzf#run()
require('packer').startup(function(use)
use('kupospelov/nvim-fzf')
end)
require('lazy').setup({
{ 'kupospelov/nvim-fzf' },
})
The default configuration:
local config = {
options = {},
layout = {
tmux = '-p90%,60%',
window = { width = 0.9, height = 0.6 },
},
}
Settings can be changed using the setup
function that accepts a table with the following fields:
options
contains options forfzf
.layout
configures the size and position of thefzf
window.tmux
contains the arguments to pass to thefzf-tmux
command.window
contains thewidth
andheight
of the popup window in the range from0.0
to1.0
.
The plugin uses a tmux popup when used in a tmux session. The tmux popup can be disabled by setting a layout
that only has window
set:
local fzf = require('fzf')
fzf.setup({
layout = {
window = {
width = 0.9,
height = 0.6,
},
},
})
The plugin exports functions that you can use to create custom mappings or commands:
vim.keymap.set('n', '<C-P>', fzf.files)
vim.keymap.set('n', '<C-P>', function()
fzf.files('ls')
end)
Function | Description |
---|---|
buffers |
Open buffers. |
files |
Files to open. An optional source command can be passed as a parameter to be used as input instead of $FZF_DEFAULT_COMMAND . |