camspiers / snap

A fast finder system for neovim.
The Unlicense
483 stars 16 forks source link

Search current buffer content #54

Closed spywhere closed 3 years ago

spywhere commented 3 years ago

Hi, I can't help but notice that the project contains producer.vim.currentbuffer which to me it seems to populate what I want (a content to search for). Now, I already tried to figure out how to use it and here's the result...

local snap = require('snap')
snap.run({
  producer = snap.get('producer.vim.currentbuffer'),
  select = snap.get('select.currentbuffer').select,
})
Screen Shot 2564-06-26 at 18 19 28

And as you can see, the producer does indeed populate the content of current file, but the filtering is not working.

So, could you help on how to setup or see why the filtering is not properly working?

spywhere commented 3 years ago

nvm, got it working with

local snap = require('snap')
snap.run({
  producer = snap.get('consumer.fzf')(snap.get('producer.vim.currentbuffer')),
  select = snap.get('select.currentbuffer').select
})