Thursday, April 1, 2010

Re: Search & Replace

Kunal Bajpai wrote:
> I have been using Vim for about 3-4 months and am a student web
> developer. I am still learning Vim and need help with a command.
> I am editing some web pages using web pages many a times I have to
> edit web pages. Here is what I want:
>
> ______________________________
> <p>Mike
> Gilbert
> Senior</p>
> _____________________________
>
> I need a command that selects the whole html code including the
> newline character.

While you can include "\n" in your search pattern for the newline,

/<p>Mike\nGilbert\nSenior<\/p>

you don't specify *what* you want to do with it once you've
selected it. Do you want to replace all or a portion with
something? Do you want to indent it? Capitalize it?

With more information, it may be possible to get a solution to
modify all your files in one pass. You may also read up in the
help regarding windo/argdo/bufdo/tabdo for performing an action
on a collection of files (since you mention multiple pages).

-tim

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

To unsubscribe, reply using "remove me" as the subject.

No comments:

Post a Comment