Thursday, August 4, 2011

Re: A few questions about :append and ex

> For such an example, I'd use a combination of :put with the
> expression register, which takes a list:
>
> :put=[var, 'line2', '.', 'that was a line with 1 period']
>
> which pretty cleanly seems to do what you want for both cases.

And thank you for the explanation. It's really cleaner than my command;


> > b) Has ex an option such as -s (meaning string) so that a sh user
> > could write the previous example this way
> > sh -s '%s/pattern/replace/g | w' file
> > (bash or zsh users can already use<<< for this, but I need sh in my
> > case). What I don't like about ex ...<<EOF, is that it looks weird in
> > an indented script (the here document must be stuck to the left margin it
> > seems)
>
> I'm not sure I follow this example...you never invoke vim/vi/ed/ex
> to edit the stream. And for the change in question, unless your
> "pattern" includes vim-specific tokens, I'd be tempted just to use
> sed.

And in fact I even meant ex.
My question is, is it possible to pass commands to ex without stdin?
(-c does not do exactly the same thing)

By the way is there a man ex. Because man ex is equivalent to man vim
and I do not find very clearly what options take ex (at least the fact
that ex reads the commands from stdin does not appear clearly, but maybe
I've not read the right line)

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

No comments:

Post a Comment