mhinz / mhinz/vim-grepper

Can I pass multiple arguments to grepprg?

Open
#249 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vim Script
Stars
1.2k
Forks
62
PR merge metrics
No merged PRs in 30d

Description

I know we can pass the `$*`(the grep text) to `grepprg`, but can we also specify the root-directory I want to grep from? i.e.

```vim
let g:grepper = {
\ 'grep': {
\ 'grepprg': 'grep -Rn arg0_grep_text arg1_the_folder'
\ },
\ 'tools': ['grep']
\}
```

Then in vim:
```bash
:Grepper -tool grep -quickfix -highlight
# in prompt
grep -Rn arg0_grep_text arg1_the_folder> my-text-for-grep my-folder-path-for-grep
```

The `arg1_the_folder` really matters when your project too big and u need to limit the result in a given folder.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading how grepprg is handled in the :Grepper prompt flow, especially how the grep text is passed to the configured command. Confirm that the prompt can preserve both the search text and a root-folder argument, then verify that the resulting grep command limits results to that folder.

Written by the indexing model from the issue text.

Assessment

Tech stack
vim
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.