`grep` with any tool in Vim.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
autoload
doc
plugin
.gitignore
README.md

README.md

grepany

grepany finds and runs any grepping tool in Vim and shows the results in a split window.

The plugin finds the tool by going from the fastest to the slowest (according to benchmarks):

  1. git-grep
  2. pt
  3. ag
  4. ack
  5. grep

Installation

Vundle:

Plugin 'gummesson/vim-grepany'

NeoBundle:

NeoBundle 'gummesson/vim-grepany'

vim-plug:

Plug 'gummesson/vim-grepany'

Pathogen:

git clone https://github.com/gummesson/vim-grepany ~/.vim/bundle

Usage

:Grep[!] [options] {pattern} [{directory}]

For more commands, usage examples and configuration options, go check out the documentation.

Mappings

In the quickfix or location-list window, you can use the following mappings:

o       Open the file (same as <Enter>).
O       Open the file and close the |quickfix| or |location-list|
        window.
go      Preview the file (open but maintain focus on the results).
z       Open the file and place the result in the middle of the screen.
Z       Open the file, place the result in the middle of the screen and
        close the |quickfix| or |location-list| window.
gz      Preview the file and place the result in the middle of the
        screen.
t       Open the file in a new tab.
T       Open the file in new tab silently.
h       Open the file in horizontal split.
H       Open the file in horizontal split silently.
v       Open the file in vertical split.
gv      Open the file in vertical split silently.
q       Close the |quickfix| or |location-list| window.

Acknowledgements

The code base is largely adapted from plugins like ack.vim and ag.vim.

License

The MIT License (MIT)

Copyright (c) 2014 Ellen Gummesson

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.