Friday, November 27, 2009

Re: Concatenate Commands

On Fri, 27 Nov 2009 08:07:44 +0100, Johannes Bauer wrote:
> Hi vimers,
>
> I've got a simple question: How can I concatenate two commands in
> command mode so that they're on one line? I want something like this
>
> :%s/foo/bar/g
> :wn
>
> I'd like to concatenate them like (pseudosyntax, this will yield a
> E488)
>
> :%s/foo/bar/g :wn
>
> So that it would search/replace/write/next and I can inspect the next
> file immediately and repeat the command, if applicable.
>
> Thanks in advance,
> Johannes
>

Seperate the commands with a '|' character.

e.g.

: %s/foo/bar/g | wn

You can learn more by

:help :bar


--
<<< Eagles may soar, but weasels don't get sucked into jet engines >>>
8:35am up 91 days 15:33, 1 user, load average: 1.35, 1.51, 2.38
Registered Linux User #232457 | LFS ID 11703

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment