On 13/11/13 21:10, john Culleton wrote:
I want to apply a batch file "foo" to a text file "bar".
The commands in foo are of the form:

:% s/elephant/\\idx{&}/g

(I can delete the : if that helps.)

So given these facts what does the command line for vim or ex
look like? In particular I need to know how to get both foo and
bar into the command.  This is to build an index for TeX.

Linux of course.

In addition to Tim's reply, this sounds like a case for running Vim "in batch mode" if you want to do it at the command prompt without the need for an interactive Vim editor:

        vim -es -S foo bar

This assumes that your "batch file" ends with a quit command (for instance :x), otherwise you can add that at the command-line:

        vim -es -S foo -cx bar

The : at the start of each line may be omitted, but you don't have to.

See
        :help -e
        :help -s-ex
        :help -S
        :help -c

If you have a symlink named "ex" which redirects to Vim, then the -e switch can be omitted:

        ex -s -S foo -cx bar


Best regards,
Tony.
--
Really heard in court in the U.S.A.:
Q.: Were you present when your photo was taken?
A.: Are you kidding?

--
--
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/groups/opt_out.

Reply via email to