Re: substitude, write and close with one command

2006-10-16 Thread Tomas Lovetinsky

Peter Hodge napsal(a):

--- Tomas Lovetinsky <[EMAIL PROTECTED]> wrote:


Hi,
I would like to ask you for help with my problem. I think it is simple but in
fact I'm not able to 
find the solution as quickly as I need.

I need to do sometink like
:s/a/b/g :wq
It means to substitute, write and close file.


Hello,

You can separate multiple commands using '|', therefore:

  :s/a/b/g | wq

regards,
Peter



Thanks to all for your advices - it works well!

Tomas


Re: substitude, write and close with one command

2006-10-16 Thread Peter Hodge
--- Tomas Lovetinsky <[EMAIL PROTECTED]> wrote:

> Hi,
> I would like to ask you for help with my problem. I think it is simple but in
> fact I'm not able to 
> find the solution as quickly as I need.
> I need to do sometink like
> :s/a/b/g :wq
> It means to substitute, write and close file.

Hello,

You can separate multiple commands using '|', therefore:

  :s/a/b/g | wq

regards,
Peter



 
On Yahoo!7 
Caller tones: Replace your ring tone with your favourite sound clip! 
http://callertones.yahoo7.mnetcorporation.com/ctonesmailtag



Re: substitude, write and close with one command

2006-10-16 Thread Gregory Margo
Most commands may be separated by a vertical bar (|), see :help :bar
This will do what you want:
:s/a/b/g | w | q

On Mon, Oct 16, 2006 at 01:34:31PM +0100, Tomas Lovetinsky wrote:
> Hi,
> I would like to ask you for help with my problem. I think it is simple but 
> in fact I'm not able to find the solution as quickly as I need.
> I need to do sometink like
> :s/a/b/g :wq
> It means to substitute, write and close file.
> 
> Is there any solution?
> 
> Thank you all in advance
> 
> Tomas Lovetinsky

-- 
+
Gregory H. Margo
gmargo at yahoo/com, gmail/com, pacbell/net; greg at margofamily/org


Re: substitude, write and close with one command

2006-10-16 Thread A.J.Mechelynck

Tomas Lovetinsky wrote:

Hi,
I would like to ask you for help with my problem. I think it is simple 
but in fact I'm not able to find the solution as quickly as I need.

I need to do sometink like
:s/a/b/g :wq
It means to substitute, write and close file.

Is there any solution?

Thank you all in advance

Tomas Lovetinsky



:s/a/b/g |wq

see ":help :bar" and keep reading until you've scrolled down a hundred lines 
or so.


Note: Without a |range| between : and s the substitute will act only on the 
current line.



Best regards,
Tony.