A minimalistic fzf plugin.
This project is heavily inspired by fzf.vim, but has a few differences:
- Pure Lua implementation
- Much smaller codebase
- No dependencies
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:
optionscontains options forfzf.layoutconfigures the size and position of thefzfwindow.tmuxcontains additional options forfzf-tmux.windowcontains thewidthandheightof the popup window in the range from0.0to1.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. |