Skip to content

Make grep tool configurable #34

@fmthoma

Description

@fmthoma

E.g. in ~/.vgrep/config.yaml:


backend:
    grep-command: "grep -nH --color=always"
    recursive-grep-command: "grep -rnHI --color=always"
    

Use cases:

  • People who want to use ack/ag instead of grep
  • Passing custom options (like -i) by default

OTOH:
Part of the functionality can simply be emulated using a shell alias:

alias vgrep='function __ack_vgrep() { ack --color "$@" | vgrep; }; __ack_vgrep'

with the restriction that some arguments (like --help, --version) will produce garbled output, and that piping (vgrep foo | vgrep bar) is not possible.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions