cream-replacemulti : Replace text across multiple files
| script karma
Downloaded by 1015
Comments, bugs, improvements
script versions (upload new version)
This script replaces text across multiple files. It is a pure Vim implementation and does not depend on external utilties that do similar things (like sed, grep, cat, or Find). As such, it is cross-platform and has been tested on both Windows95/XP and Linux.
Replace Multi is intended to be used in the GUI version of Vim, gVim. It presents a rather hackish dialog to take user input for the Find, Replace, and Path components and present options for Case Sensitivity and the use of Vim's Regular Expressions. (Some day in the future it might be adapted to work from the command line without a dialog.)
In testing, Replace Multi performed a replacment operation on 1000 small files in 25 seconds. (2.80Ghz Pentium 4 Windows XP machine with 1Gb of RAM.) Obviously Vim and system settings could vary this greatly, but as a benchmark this is about 40 files/second.
This is one of many custom utilities and functions for gVim from the Cream project (http://cream.sourceforge.net), a configuration of Vim for those of us familiar with Apple and Windows software.
This script is dependant on MultVals (http://www.vim.org/script.php?script_id=171).
Just drop cream-replacemulti.vim and multvals.vim into your plugins directory. Then (re)start Vim and use the command line to call function Cream_replacemulti():
or use mappings like:
imap <C-F3> <C-o>:call Cream_replacemulti()<CR>
vmap <C-F3> :<C-u>call Cream_replacemulti()<CR>
nmap <C-F3> :call Cream_replacemulti()<CR>
Click on the package to download.
ip used for rating: 220.127.116.11