title: How to run a series of vim commands from command prompt
body: <p>I have four text files A.txt, B.txt, C.txt and D.txt
  I have to perform a series of vim editing in all these files.
  Currently how I am doing is open each files and do the same vim commands one by one.</p>
  
  <p>Is it possible to make a script file which I can run from the command prompt, means without open the actual file for vim editing.</p>
  
  <p>for example, if I have to perform the below vim commands after opening the A.txt file in vim editor:</p>
  
  <pre><code>:g/^\s*$/d
  :%s/^/[/
  :%s/\(.*\)\(\s\+\)\(.*\)/\3\2\1
  :%s/$/]/
  :%s/design/test/
  </code></pre>
  
  <p>Is it possible to make a script file and put all these commands including <code>gvim A.txt</code> (first command in the file).
  and edit run the script file from command prompt.</p>
  
  <p>If it is possible, please let me know how to do it and how it can be done with single or multiple files at a time?</p>