Skip to content

sakkke/vfzf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vfzf

A V wrapper for fzf. This is a V port of pyfzf.

Requirements

Installation

v install sakkke.vfzf

Usage

import sakkke.vfzf { new_fzf_prompt }
fzf := new_fzf_prompt()

If fzf is not available on PATH, you can specify a location:

fzf := new_fzf_prompt(executable_path: '/path/to/fzf')

Simply pass a array of options to the prompt function to invoke fzf:

fzf.prompt(choices: ['1', '2', '3'])

You can pass additional arguments to fzf as fzf_options:

fzf.prompt(choices: ['1', '2', '3'], fzf_options: '--multi --cycle')

Input items are written to a temporary file which is then passed to fzf. The items are delimited with \n by default, you can also change the delimiter (useful for multiline items):

fzf.prompt(choices: ['1', '2', '3'], fzf_options: '--read0', delimiter: '\0')

License

MIT

Thanks