On 27/01/09 16:48, Teemu Likonen 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

or:

        :%s/\_s{/ {/g

Note that every brace will be placed at the end of the preceding line 
(or, with this :s statement, at the end of the preceding non-blank 
liine). This usually isn't a problem in CSS style sheets, where normally 
only one level of braces can exist; however, in style sheets meant only 
for Gecko browsers (e.g. chrome/userContent.css in a Firefox profile) a 
second level can be introduced by @-moz-document at-rules, as follows:

@-moz-document domain("example.com") {
// rules here will only be applied in pages on <something>.example.com
}

@-moz-document  url("http://www.example.org/blahblah.html";),
                url-prefix("http://www.example.net/some/path/";)
{
   // rules here will be applied to the exact URL
   // http://www.example.org/blahblah.html
   // and to any URL starting with http://www.example.net/some/path/
}


Best regards,
Tony.
-- 
New systems generate new problems.

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

Reply via email to