Skip to content

Dynamically extend the grep-bin scan paths? #112

@goodboy

Description

@goodboy

It'd sure be handy to allow augmenting the rg/ag search paths for a given code base so as to be able to lookup defs for tokens not defined in the current repo / local directory tree.


As an example, say you are working on a project in an interpreted language like Python which enables dynamic lookup of all library paths with something like:

python -c "import os, sys; print(' '.join('{}'.format(d) for d in sys.path if os.path.isdir(d)))"

Then you could combine it with rg like so:

rg -u 'open_nursery' @$(python -c "import os, sys; print(' '.join('{}'.format(d) for d in sys.path if os.path.isdir(d)))")

And this would for example search all linked dependency libs token sets as well.


Afaict there's no global (let alone lang context specific) override variable for this?

it'd be handy to have some way to be able to conditionally augment the search domain.
For example the ALE linter plugin offers overriding the exec and options when using ruff with something like

let g:ale_python_ruff_executable = 'ruff'
let g:ale_python_ruff_options = ''

Interested to see what others think (or if i somehow just missed this in the docs 😂 )

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