sponsor Vim development Vim logo Vim Book Ad

find_in_files : To find a string in the files in current directory

 script karma  Rating -2/11, Downloaded by 1026  Comments, bugs, improvements  Vim wiki

created by
Sappy Goel
 
script type
utility
 
description
All of us when working in list of files come across the problem of searching for string in the files and then if the string is found, we manually open that file and go to a specific line.

All this can be done with a stroke of key using this script.

This script is used to find a string in files in current directory. This script copies the finding in a buffer and opens it in the same window.

To go to a particular line/file in which the string is found. Click F2 on the top of the line in the buffer.

Procedure:
1. execute :CALL "<string>" in gvim
This will execute windows findstr command and will open the file in the same buffer
2. Go to a line/file in the new buffer that you want to open.
3. Press F2

Result:
It will open up a file in a same window and will go to that line.

How to Execute:
1. :CALL "<string>"
Will search for String in all the files in current dorectory
2. Press <F3>, this will search all files in directory for string on which the cursor exists
3. Press <F4>, this will seach current file for string on which the cursor exists.
 
install details
1. untar the file
2. copy find_in_files.vim in plugin directory
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
find_in_files.zip 1.01 2003-11-26 6.0 Sappy Goel changes to use grep and copen as suggested by Gary Johnson
find_in_files.zip 1.0 2003-11-19 6.0 Sappy Goel Initial upload
ip used for rating: 18.223.114.142

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github