Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
For questions about searching for text with / or search(). For find/replace operations, use tag [substitute] instead.
99
votes
Vim search replace all files in current (project) folder
Find files that contain 'Sam'
Use Vim's :vimgrep command to search for all occurrences of Sam within the project:
:vimgrep /Sam/gj **/*
Notes:
Sam is the search "pattern" sandwiched between two forward … slashes
The **/* says to search in all files recursively
The g flag says to search for all occurrences in each line (this is actually overkill here, but it does not hurt either)
The j flag prevents vim …