Skip to content
This repository was archived by the owner on Feb 12, 2025. It is now read-only.
This repository was archived by the owner on Feb 12, 2025. It is now read-only.

[FR] Add opts hook for fzf #169

Description

@jiz4oh

I have checked the implementation of fzf, it's impossible to extend by the customer.

I have some functions like below:

function! fzf#customized#quickfix(query, fullscreen) abort
  let l:qf = getqflist()
  let l:list = map(l:qf, { _, val -> bufname(val.bufnr). ':'. val.lnum . ':' . val.col . ':'. val.text})
  if !empty(a:query)
    let @/ = a:query
  endif

  let l:actions = {
    \ 'ctrl-t': 'tab split',
    \ 'ctrl-x': 'split',
    \ 'ctrl-v': 'vsplit'
    \}
  let l:dir = getcwd()
  let l:spec = {
                \'dir': l:dir,
                \'sink*': { lines -> fzf#helper#colon_sink(lines, l:actions) },
                \'source': l:list,
                \'options': [
                  \'--expect', join(keys(actions), ','),
                  \'--ansi',
                  \'--prompt', 'Quickfix ',
                  \'--multi', '--bind', 'alt-a:select-all,alt-d:deselect-all',
                  \'--delimiter', ':', '--preview-window', '+{2}-/2'
                \]}

  call fzf#run(fzf#wrap('quickfix', fzf#vim#with_preview(l:spec), a:fullscreen))
endfunction

the fzf#run takes a single
dictionary argument, a spec, and starts fzf process accordingly. depending on the user's choice, the value of this dictionary may be very different. and usually called with fzf#wrap and fzf#vim#with_preview.

could you consider adding new opts for fzf backend like telescope which can let customers customize UI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions