Hi,
using Vim 7.4 on Windows 7. I have a text file mydata.txt where is the text. I 
need to execute Vim commands on this data to transform data in file to my 
desired content. Because data in mydata.txt file is changed very frequently I 
would like to store Vim commands in separate file e.g. commands.vim and then 
execute those commands on mydata.txt file.

Searching the web and the only solution that I have come into was the following.

1. Save bellow comment to commands.vim file:
===============
:%s/ship/vessel/ge
:%s/What/That/ge

for line in getline(1, 2)
  let @a = line
  @a
endfor
===============

2. Save bellow content to mydata.txt file.
===============
This is one big ship. What ship?
===============

3. Open mydata.txt file with Vim and execute command:
:source commands.vim

4. The result after executed above command is:
===============
This is one big vessel. That vessel?
===============

This is exactly what I want as a result in mydata.txt file, but what I don't 
like is I get the following error:
===============
Error detected while processing C:\commands.vim file:
line 6:
E492: Not an editor command: This is one big vessel. That vessel?
===============

Is there a way to avoid the error message? Commands.vim file does what I want, 
but how to remove annoying error?
Thanks

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to