On Mar 13, 10:59 am, roger koenker <[email protected]> wrote:
> %s/^M\([A-Z][ A-Z]\)/\r\1/g
> %s/^M//g
> g/^ /-1join
> write tmp
> quit
>
> If, interactively, I use
>
> :source v.vim
>
> where v.vim contains the first 3 lines of the above file, everything
> seems fine, but when I try
> on the command line
>
> vim -e -s data.txt <v.vim
>
The problem (unless there is a typo) is that you are using the wrong
command line switch.
-s (lowercase) will execute vim commands as if you typed them from
normal mode. For example, a script to execute with -s would look like
this:
jjjjllldawkgqap
You probably meant to use -S (uppercase), which will perform at
startup the equivalent of the :source command.
See :help -s and :help -S and note the subtle difference.
Same with :help :source, and see the difference with :source! (with
the '!').
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---