On 09:33 Mon 10 Dec     , Peng Yu wrote:
> Hi,
> 
> I'm wondering if there is a way to execute key strokes from a file.
> 
> For example, I want to open a file main.vim, then type i, CTRL-R, %,
> which type the filename main.vim in the file. The I type ESC and :wq
> to save the file and quit. Is there a way to automate the whole
> process in a script?
> 
> Regards,
> Peng
> 
> -- 
> 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

I am not sure if this is what you want:  you can use :argdo (or :windo,
:bufdo - what fit you better) with

:argdo normal i % 
:wa

There to type   you need to press ^V^R (i.e. CTRL-V followed by
CTRL-R), to type   you need ^V<Esc> (i.e. CTRL-V followed by the <Esc>
key).

Best,
Marcin

-- 
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

Reply via email to