Automatically update text in many documents in eclipse or any editor

Suppose I have several files that have a common expression (for example, the software version, authors or function and its manual). I want to change this expression in one file, and the rest of the files will be updated automatically.

Is there a way to do this in eclipse or any editor? or is there any software that can do this?

Something like that:

http://wordprocessing.about.com/od/wordquicktips/qt/linktext.htm

Actually, I'm looking for something like code refactoring, and I only need it for one user.

I want the files to be updated instantly.

+4
source share
4 answers

There are many ways to do this with Emacs. One simple one is to use Qin Dired.

See the Emacs manual, node Query Replace( C-h r g Query Replace) for information on standard query replacement functions, including multiple files.

There are other options for finding and replacing Emacs.

+2
source

This is not what you will find in most editors:
The function that you describe in WordProcessing will be to leave a “sitelink” in the text file, which would make your file automatically composed with:

  • contents if linked file
  • the rest of the contents of your file

​​ , :

  • , ( )

, git, , :

smudge

, git "smudge" script, .gitattributes, , .
, .

+1

This kind is easy to do with vim / gvim. It works:

:set nomore
:n `git ls-files`
:argdo sil! %s;<pattern>;<replace>;g | update
0
source

Not entirely automatic, but still

  • Ctrl+Shift+H in visual studio
  • Ctrl+Shift+F in Notepad ++ and Sublime Text

allow replacement in all files in the directory with the ability to filter by file type and optionally use a regular expression.

0
source

All Articles