Skip to content

mhinz/vim-grepper

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

The behavior changed in this commit: `8b78347`. The decision was to
unconditionally highlight the query like the user's colorscheme
highlights string literals.

I'd like to be able to customize this without changing how all string
literals look, so I've introduced a new `GrepperQuery` highlight group
that links to `String` by default. This means that there should be no
change by default.

I have not written tests for this but I have tested it in my own
configuration files by adding this line:

```vim
hi link GrepperQuery Normal
```

As seen in the diff, there is prior art for introducing new highlighting
groups in grepper already--`GrepperPrompt` is a highlight group that
controls the color of everything before the `>` (which displays the
search program and flags). There do not appear to be any tests for that
feature either, otherwise I would have cargo culted some to test this
feature.
2b93535

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
May 8, 2019 21:02
November 11, 2016 11:45
January 21, 2016 10:18
April 24, 2018 00:42

Build Status



vim-grepper



Use your favorite grep tool (ag, ack, git grep, ripgrep, pt, sift, findstr, grep) to start an asynchronous search. All matches will be put in a quickfix or location list.

This plugin works with Vim and Neovim on Unix-like systems. It's mostly working on Windows as well.

Disclaimer: From my point of view it's feature-complete, so I won't add new features or put much time into reviewing complex PRs.


  • Prompt: Use :Grepper to open a prompt, enter your query, optionally cycle through the list of tools, fire up the search.
  • Operator: Use the current visual selection to pre-fill the prompt or start searching right away.
  • Commands: :Grepper supports a wide range of flags which makes it extremely flexible. All supported tools come with their own command for convenience: :GrepperGit, :GrepperAg, and so on. They're all built atop of :Grepper.
  • Custom tools: Changing the behaviour of the default tools is very easy. And so is adding new tools.

If you like ack.vim and ag.vim, you will love vim-grepper.

Documentation

This README is only the tip of the iceberg. Make sure to read :h grepper and the wiki to learn about every feature.

Example configurations be be found here.

The truth is out there.

Installation

Use your favorite plugin manager, e.g. vim-plug:

Plug 'mhinz/vim-grepper'

If you prefer lazy loading:

Plug 'mhinz/vim-grepper', { 'on': ['Grepper', '<plug>(GrepperOperator)'] }

Demo

General usage:

vim-grepper

Grepping only files currently loaded in Vim:

vim-grepper

Feedback

If you like this plugin, star it! It's a great way of getting feedback. The same goes for reporting issues or feature requests.

Contact: Twitter