User Tools

Site Tools


blog:vim_replace_in_multiple_files

This is an old revision of the document!


vim replace in multiple files

<quote>

vim *.cpp		Start Vim, defining the argument list to
			contain all the C++ files.  You are now in the
			first file.
qq			Start recording into the q register
:%s/\<GetResp\>/GetAnswer/ge
			Do the replacements in the first file.
:wnext			Write this file and move to the next one.
q			Stop recording.
@q			Execute the q register.  This will replay the
			substitution and ":wnext".  You can verify
			that this doesn't produce an error message.
999@q 			Execute the q register on the remaining files. 

<quote>

~~LINKBACK~~

Discussion

Enter your comment. Wiki syntax is allowed:
   ___    __  ___  __  __   __ __   _  __
  / _ )  /  |/  / / / / /  / // /  | |/_/
 / _  | / /|_/ / / /_/ /  / _  /  _>  <  
/____/ /_/  /_/  \____/  /_//_/  /_/|_|
 
blog/vim_replace_in_multiple_files.1294151947.txt.gz · Last modified: 2011-01-04 15:39 by brb