Initial commit
Extract search vimrc into config_search

A single place to find things.
Use better defaults for grep

Add gs alias for smarter grepping on the command line. It avoids version
control directories and vim swap files. (Are there other temp files I
should exclude?)

Set GREP_OPTIONS in vim so :grep doesn't look in .git. This might break
things, so I added an easy way to toggle it. Remove grep setings from
the local template since I'm now always changing grepprg.
Use vimgrep instead of findstr if grep is not found
Make visual g*/g# ignore regex characters

Since search thinks forward slashes indicate the end of the query,
escape them. Also add a preceeding \V so other special characters are
interpreted literally (like . or ~).
Do a better job escaping for g*/g#

Use the built-in escape function!
Group quick run and disable

I've hit these by accident (which can do bad things) and don't use them
often anymore. Neither is search, so keep them in vimrc.
Use noremap instead of map where possible
Make ClearAllButMatches a command

It's easier to call commands and it's not more useful to use
ClearAllButMatches as a function.
Make ClearAllButMatches accept a range

Now you can select lines you want to clear. Only what matches your
search will remain.
Clarify how ClearAllButMatches for multiple matches
Properly handle reverse searching for g#

When we're searching in reverse, we need to escape ? instead of /
Add && for repeat replace on visual selection
Add SearchForAnyLine to build a search query

I often pare down a list of items (one per line) and then want to search
for them. This automates building the query from the list.
Add map to search within visual block

%V lets you search within the last visual block selection.
Add QFilter command to modify quickfix

Sometimes I have entries in the quickfix that I want to ignore. This is
a simple way to remove them.

Maybe can replace with https://github.com/jceb/vim-editqf which lets you
edit the quickfix just like normal text.
Search for whole words with SearchForAnyLine

Also wraps in braces to make it easy to modify the query (and allow use
of ToggleWholeWord).
Clean up visual and normal & maps

I sometimes get confused between these and the built-ins. Adjust them so
they all make sense to me.

& is the flag meaning use the same flags as last time, so commands that
use & should always re-use flags.

Make g& work on visual selection.

g& and && on visual selection are very close, but g& use the current
query (which may have changed).
Don't grep for tagfiles

My tagfiles (ctags, cscope, and ctrlp) almost always match search
queries but don't contain useful results.

Unfortunately, this means I cannot grep them at all without switching to
basic grep.
Add simple refactor map

Mapped to gr (I don't use virtual edit features, so I don't need gr).

Source: http://stackoverflow.com/a/597932/79125