Skip to content

Support git-grep with a base path argument #10

@bernardassan

Description

@bernardassan

My first idea

  • Change the rg and grep to include the pattern in the grep-cmd
  • Then use printf to interpolate fzf's {q} to interpolate the query back into the grep-cmd

} elif ?(e:git rev-parse --is-inside-work-tree stdout>$os:dev-null stderr>&stdout) {
# TODO: git doesn't support having `pattern` at the end when path is
# specified .ie `git grep directory/ "pattern"`
set cmd = [
env
LC_ALL=C
git
grep
--untracked
--perl-regexp
--color=always
--line-number
--column
--ignore-case
]

--bind "start:reload("$rg-prefix" {q})+unbind(ctrl-r)" ^
--bind "change:reload:"$rg-prefix" {q}" ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions