Using FZF in Vim, is it possible to search project directory and a library directory? For example when executing FZF, it would search directories:
~/project/
and ~/libs/include
, and provide results.
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
Sign up to join this communityUsing FZF in Vim, is it possible to search project directory and a library directory? For example when executing FZF, it would search directories:
~/project/
and ~/libs/include
, and provide results.
You can specify the command to obtain the input of fzf by using the fzf#run()
function.
In your case, this can look something like this:
call fzf#run({'source': 'find ~/project/ ~/libs/include -type f',
\ 'sink': 'edit'})
and if you want, you can add a command like this
command! FZFLib call fzf#run({'source': 'find ~/project/ ~/libs/include -type f', 'sink': 'edit'})
The options of fzf#run()
are listed on the fzf homepage
FZF will search the total pwd. If pwd is ~
, both directories ~/project/
and ~/libs/include
will be searched.