junegunn / junegunn/fzf.vim

Custom Ag command with custom sink option?

Open
#730 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Vim Script
Stars
10.3k
Forks
608
Avg merge
5d 8h
Merged PRs (30d)
2

Description

- Category
- [x] Question
- [ ] Bug
- [ ] Suggestion

If I want a custom `Ag` command, which would only "grep" the contents of one particular folder, and would then pass the selection to a custom command, what is the best solution to this task? Is there any way to do this by extending `fzf#vim#ag` function like it is shown in README, for example?

As of now, I came up with this:

command! MyFZFList call fzf#run({
\ 'source': "rg . --no-heading --column --glob '*.txt' '/My/Very/Folder'",
\ 'sink': 'MyCustomCommand',
\ 'options': '-s',
\ 'down': '40%'})

But may be there is a better way? Thanks :)

(BTW, this `-s` option, it's not really needed any more, it seems?)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.