michal-h21 / vim-zettel

VimWiki addon for managing notes according to Zettelkasten method
MIT License
557 stars 73 forks source link

Passing regex to the ag command used in :ZettelOpen (or :ZettelSearch) #87

Open thorlucas opened 3 years ago

thorlucas commented 3 years ago

Hi,

I'd like to make my ZettelOpen/ZettelSearch only search across markdown headers. This means I need to run ag with the following regex: ^#+\s.+$.

Now I've spent probably two hours now searching through fzf and vim-zettel code to try to understand how to do this, but I just can't wrap my head around everything that's going on.

Any tips on how I could accomplish this? The fzf/ag works the way I would like it do if I run the command: :Ag ^#+\s.+$. Although it then needs to sink this file and paste it in the case of ZettelSearch...

I'd also like to pass to ag additional options, like --color-match="0;0" --nonumbers

Thanks,