Code Monkey home page Code Monkey logo

buffergrep's Introduction

This is a mirror of http://www.vim.org/scripts/script.php?script_id=2255

Searches for strings in open buffers.  Instead of supplying a filename wildcard to direct the search, the grep command will search in open buffers which may or may not be represented by a file on the disk.  Moreover, since buffers are searched, changes that have not been saved to disk are scanned.  Unlisted, quickfix, and help buffers are skipped.

Each grep command uses the same syntax as the builtin :vimgrep and :lvimgrep commands.  Results are displayed in the quickfix list.

The following commands are defined:

Bgrep - searches all buffers listed with the :buffers command, skipping over unlisted, quickfix, and help buffers.  Analagous to :bufdo.
Agrep - searches all buffers listed with the :args command.  Analagous to :argdo.
Wgrep - searches all buffers visible on the screen (current tab page only).  Analagous to :windo.
Tgrep - searches all buffers open on any tabpage.  Analagous to :tabdo.

Example:

Bgrep /jhonka/  "find string 'jhonka' in all loaded buffers.
Wgrep |foo|j  "find string 'foo' in all buffers currently on the screen, but don't jump to first match.
Tgrep !bar!g  "find string 'bar' in all buffers visible in all tabpages, and list each occurance of 'bar', not just the first one on a line.
Agrep baz    "find string 'baz' in all buffers from the args list; specifying the pattern this way means you can't use flags.

Of course, the argument isn't just a literal string, it is a regular expression.  You man use any valid Vim regular expression atoms in your search.

buffergrep's People

Contributors

fadein avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.