Skip to content

Commit 5b39e1b

Browse files
committed
Add motivation to README
1 parent f04fa42 commit 5b39e1b

File tree

1 file changed

+44
-35
lines changed

1 file changed

+44
-35
lines changed

README.md

Lines changed: 44 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,63 +3,72 @@ vim-easygrep
33

44
Fast and Easy Find and Replace Across Multiple Files
55

6-
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.
6+
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.
77

8-
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 <leader>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 <leader>vr or use the :Replace command. Setting options is easy, simply type <leader>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.
8+
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 <leader>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 <leader>vr or use the :Replace command. Setting options is easy, simply type <leader>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.
99

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

12-
Keymappings:
12+
## Why EasyGrep?
1313

14-
<Leader>vv - Grep for the word under the cursor, match all occurences,
15-
like |gstar|
16-
<Leader>vV - Grep for the word under the cursor, match whole word, like
17-
|star|
18-
<Leader>va - Like vv, but add to existing list
19-
<Leader>vA - Like vV, but add to existing list
20-
<Leader>vr - Perform a global search search on the word under the cursor
21-
and prompt for a pattern with which to replace it.
22-
<Leader>vo - Select the files to search in and set grep options
14+
* Supports multiple Grep programs (vimgrep, grep, ack, ag, pt, csearch)
15+
* Mapping-based or command-line searches
16+
* Allows searching all files, just buffers, or a user-specified pattern.
17+
* Automatically escapes non-literal patterns
2318

24-
Commands:
19+
## Using Easygrep
2520

26-
:Grep [arg]
27-
Search for the specified arg, like <Leader>vv. When an ! is added,
28-
search like <Leader>vV
21+
Keymappings:
2922

30-
:GrepAdd [arg]
31-
Search for the specified arg, add to existing file list, as in
32-
<Leader>va. When an ! is added, search like <Leader>vA
23+
<Leader>vv - Grep for the word under the cursor, match all occurences,
24+
like |gstar|
25+
<Leader>vV - Grep for the word under the cursor, match whole word, like
26+
|star|
27+
<Leader>va - Like vv, but add to existing list
28+
<Leader>vA - Like vV, but add to existing list
29+
<Leader>vr - Perform a global search search on the word under the cursor
30+
and prompt for a pattern with which to replace it.
31+
<Leader>vo - Select the files to search in and set grep options
3332

34-
:Replace [target] [replacement]
35-
Perform a global search and replace. The function searches
36-
the same set of files a grep for the desired target and opens a dialog to
37-
confirm replacement.
38-
39-
:ReplaceUndo
40-
Undoes the last :Replace operation. Does not stack successive
41-
searches; only the last replace may be undone. This function may not
42-
work well when edits are made between a call to Replace and a call to
43-
ReplaceUndo.
33+
Commands:
34+
35+
:Grep [arg]
36+
Search for the specified arg, like <Leader>vv. When an ! is added,
37+
search like <Leader>vV
38+
39+
:GrepAdd [arg]
40+
Search for the specified arg, add to existing file list, as in
41+
<Leader>va. When an ! is added, search like <Leader>vA
42+
43+
:Replace [target] [replacement]
44+
Perform a global search and replace. The function searches
45+
the same set of files a grep for the desired target and opens a dialog to
46+
confirm replacement.
47+
48+
:ReplaceUndo
49+
Undoes the last :Replace operation. Does not stack successive
50+
searches; only the last replace may be undone. This function may not
51+
work well when edits are made between a call to Replace and a call to
52+
ReplaceUndo.
4453

4554
:GrepOptions
4655
Open a window to set grep options.
4756

48-
:GrepProgram [+arg]
57+
:GrepProgram [+arg]
4958
Select a grep program from a list of programs found on your system. An
5059
optional argument may be provided to switch to the program without user
5160
interaction.
5261

53-
:GrepRoot [+arg]
62+
:GrepRoot [+arg]
5463
Configure the location that EasyGrep searches from. An optional argument
5564
may be provided to switch to the program without user interaction.
5665
Roots:
5766
1. The current directory. As the current directory changes, the search
5867
location changes automatically.
5968
2. A dynamic directory that easygrep searches for. This is useful for
6069
finding the root of a project with a marker like ".git".
61-
3. A user specified directory. The search location is fixed and does
70+
3. A user specified directory. The search location is fixed and does
6271
not change.
63-
64-
72+
73+
6574

0 commit comments

Comments
 (0)