|
osdir.com mailing list archive |
|
|
|
Subject: Re: multiline substitution - msg#00468List: editors.vim
This would work if ure using vim 6x
%s/<TAG_TO_DELETE\_.\{-}> %s - replace all <TAG_TO_DELETE - starting pattern \_. - any character on any line, including line break \{-} - 0 or more - as few as possible > - ending pattern Check out: :he /\{- :he \_. ----- Original Message ----- From: "luis jure" <luisjure@xxxxxxxxxxxxxxx> To: "Vim list" <vim@xxxxxxx> Sent: Tuesday, June 18, 2002 9:07 AM Subject: multiline substitution > hello, > > i'm new to the list, and while not exactly "new" to vim (i've been using it for > some time now) i consider myself still a newbie. so please excuse me if i come > with some basic questions to the list. > > what i'd like to ask now is if there is a way to make substitutions on patterns > extending over more than one line. > > the particular case i'm interested now is how to delete unwanted html tags. > those can begin anywhere in a line and end in the same line or the following > one, or even two lines below. now i do it by hand thus: > > /<TAG_TO_DELETE > v > /> > x > > > but i'd like to know if it would be possible to do the same using a single > command. > > best, > > lj
Thread at a glance:
Previous Message by Date: (click to view message preview)multiline substitutionhello, i'm new to the list, and while not exactly "new" to vim (i've been using it for some time now) i consider myself still a newbie. so please excuse me if i come with some basic questions to the list. what i'd like to ask now is if there is a way to make substitutions on patterns extending over more than one line. the particular case i'm interested now is how to delete unwanted html tags. those can begin anywhere in a line and end in the same line or the following one, or even two lines below. now i do it by hand thus: /<TAG_TO_DELETE v /> x but i'd like to know if it would be possible to do the same using a single command. best, lj Next Message by Date: click to view message previewRe: Generating HTML filesThanks, that was exactly what I was looking for. []s --af -- Alexandre M Florio Grupo de Tecnologia da Informação Empresa Júnior PUC-Rio http://www.empresajunior.com.br/ On Mon, 17 Jun 2002, Colin Keith wrote: > On Mon, Jun 17, 2002 at 12:59:36AM -0300, Alexandre Florio wrote: > > does anyone know some tool that converts a source file in a > > certain format to an HTML one (with all the syntax highlighting > > formatting) ? > > > Yes, Vim does. See ":help convert-to-HTML" > Previous Message by Thread: click to view message previewmultiline substitutionhello, i'm new to the list, and while not exactly "new" to vim (i've been using it for some time now) i consider myself still a newbie. so please excuse me if i come with some basic questions to the list. what i'd like to ask now is if there is a way to make substitutions on patterns extending over more than one line. the particular case i'm interested now is how to delete unwanted html tags. those can begin anywhere in a line and end in the same line or the following one, or even two lines below. now i do it by hand thus: /<TAG_TO_DELETE v /> x but i'd like to know if it would be possible to do the same using a single command. best, lj Next Message by Thread: click to view message previewpdf reference guide [was multiline substitution]el Tue, 18 Jun 2002 09:30:58 +0530 Gowri S <gowris@xxxxxxxxxxxxxx> escribió: > This would work if ure using vim 6x > %s/<TAG_TO_DELETE\_.\{-}> that works great, thanks. > \_. - any character on any line, including line break i didn't know that one, great tip. i'm using vim6.1, but i still have the VIM 5.6 Reference Guide that i printed from a pdf some time ago. it seems the documentation is not available in pdf anymore, or is it? what are you vimers using for reference, short of printing every txt file in doc/? best, lj
Web Hosting Reviews from OSDir.com Sister Site iBizWebHosting.com
|
|