Code Monkey home page Code Monkey logo

vim-easygrep's Introduction

vim-easygrep

Fast and Easy Find and Replace Across Multiple Files

EasyGrep is a plugin for performing search and replace operations through multiple files. Vim already has builtin support for searching through files with its 'vimgrep' and 'grep' commands, but EasyGrep makes using them much, much easier. It also provides a powerful "Replace in Files" operation, something that is not very easy to do in Vim by default. With EasyGrep, you can specify with high-precision exactly the type of files you want to search, whether it be all files, only open buffers, only files matching a pattern, etc. Additionally, you can easily specify searching through hidden files, case-sensitivity, performing a recursive search, and many more options that make searching more easy.

EasyGrep provides both key mappings and commands to make search and replace easy. When using EasyGrep, searching for a word is as easy as typing vv (v v, not double-u) over the word for which you want to search. This search can also be accomplished with the :Grep command and a user-specified pattern. Performing a "replace in files" is similar; type vr or use the :Replace command. Setting options is easy, simply type vo or :GrepOptions. EasyGrep provides a great set of defaults but can also be configured to start up just how you like it; see the script for these options. Most vimgrep (and grepprg) options are supported.

For a screencast of the script in action go here: http://downloads.veryspeedy.net/vim/EasyGrep.gif

Keymappings:

<Leader>vv  - Grep for the word under the cursor, match all occurences, 
              like |gstar| 
<Leader>vV  - Grep for the word under the cursor, match whole word, like 
              |star| 
<Leader>va  - Like vv, but add to existing list 
<Leader>vA  - Like vV, but add to existing list 
<Leader>vr  - Perform a global search search on the word under the cursor 
              and prompt for a pattern with which to replace it. 
<Leader>vo  - Select the files to search in and set grep options 

Commands:

:Grep [arg] 
    Search for the specified arg, like <Leader>vv.  When an ! is added, 
    search like <Leader>vV 

:GrepAdd [arg] 
    Search for the specified arg, add to existing file list, as in 
    <Leader>va.  When an ! is added, search like <Leader>vA 

:Replace [target] [replacement] 
    Perform a global search and replace.  The function searches 
    the same set of files a grep for the desired target and opens a dialog to 
    confirm replacement. 
 
:ReplaceUndo 
    Undoes the last :Replace operation.  Does not stack successive 
    searches; only the last replace may be undone.  This function may not 
    work well when edits are made between a call to Replace and a call to 
    ReplaceUndo. 

:GrepOptions [arg] 
    Open a window to set grep options.

vim-easygrep's People

Contributors

alvaromartin avatar dkprice avatar

Watchers

 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.