Loading ...
Sorry, an error occurred while loading the content.

Re: search something and move it somewhere (something -> endOfLine.something)

Expand Messages
  • Tim Chase
    ... should perform the transformation for you. ( capture stuff as 1 s* leading space / * an opening comment literal . {-} anything, as little
    Message 1 of 6 , Sep 14, 2009
    • 0 Attachment
      > I guess I could be more clear about what I need:
      >
      > I have: li.cat-item-9{ /* fedorka */ background: #C7DE8E; }
      > I need: li.cat-item-9{ background: #C7DE8E; } /* fedorka */

      That is indeed helpful:

      :%s@\(\s*/\*.\{-}\*/\)\(.*\)@\2\1

      should perform the transformation for you.

      \( capture stuff as \1
      \s* leading space
      /\* an opening comment literal
      .\{-} anything, as little as possible until we hit
      \*/ a closing comment literal
      \) end capture of \1
      \(.*\) the rest of the line captured as \2

      Without capturing the space before the "/*" it just moves the
      comment, so you end up with

      ...DE8E; }/* fedorka */

      -tim




      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.