Thomas Allen wrote:
> On Jan 27, 10:48 am, Teemu Likonen <[email protected]> wrote:
>> 703designs (2009-01-27 07:28 -0800) wrote:
>>
>>> I'm working with some CSS formatted
>>> p
>>> {
>>>     property: values;
>>> }
>>> What sort of find/replace command should I use to delete the newline
>>> before the brace for all declarations?
>> How about g command?
>>
>>     :%g/^{/normal kJ
> 
> I had no idea that I could include commands in a replace. Thanks!


It's not a replacement...it's an action to be performed on lines 
that match the pattern.  This "normal" version can be shortened 
using Ex commands to just be

   :g/^{/-j

which means

   g        on every line that matches
   ^{       a "{" at the beginning of the line
   -        on the previous line
   j        join this (previous) line with the next

-tkc




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

Reply via email to