added the option to supply extra fzf_args

main
bhagwan 3 years ago
parent 565e76bdfa
commit 192a386087

@ -139,6 +139,7 @@ require'fzf-lua'.setup {
win_row = 0.30, -- window row position (0=top, 1=bottom)
win_col = 0.50, -- window col position (0=left, 1=right)
win_border = true, -- window border?
fzf_args = '', -- adv: fzf extra args, empty unless adv
fzf_layout = 'reverse', -- fzf '--layout='
preview_cmd = '', -- 'head -n $FZF_PREVIEW_LINES',
preview_border = 'border', -- border|noborder

@ -52,10 +52,11 @@ M.build_fzf_cli = function(opts)
opts.prompt = opts.prompt or cfg.default_prompt
opts.preview_offset = opts.preview_offset or ''
local cli = string.format(
[[ --layout=%s --bind=%s --prompt=%s]] ..
[[ %s --layout=%s --bind=%s --prompt=%s]] ..
[[ --preview-window='%s%s' --preview=%s]] ..
[[ --expect=%s --ansi --info=inline]] ..
[[ %s %s]],
opts.fzf_args or cfg.fzf_args or '',
opts.fzf_layout or cfg.fzf_layout,
utils._if(opts.fzf_binds, opts.fzf_binds,
vim.fn.shellescape(table.concat(cfg.fzf_binds, ','))),

@ -52,6 +52,7 @@ function M.setup(opts)
win_col = "number",
win_border = "boolean",
default_prompt = "string",
fzf_args = "string",
fzf_layout = "string",
fzf_binds = "table",
preview_cmd = "string",

Loading…
Cancel
Save