[tpm] reflowing comments in vim

Fernando Oliveira fernandocorrea at gmail.com
Thu Dec 8 10:25:25 PST 2011


:map ccc J:s/ #//g<CR>I# <ESC>

then, <shift>+v select all comments, than press ccc



Just another Perl Hacker,
Fernando (SmokeMachine)


2011/12/8 Doug Lalonde <douglalonde at gmail.com>

> Hi Olaf,
>
> Try :%s/blah\n#/blah/g
>
> Doug
>
> On 8 December 2011 12:08, Olaf Alders <olaf at vilerichard.com> wrote:
> > Hi Folks,
> >
> > I'm a bit clueless when it comes to vim.  Given comments in code which
> look like this:
> >
> > # blah
> > # blah blah blah blah
> > # blah
> >
> > I'd like to be able to reflow them to look like this:
> >
> > # blah blah blah blah blah blah
> >
> > I'd like to preserve indentation and respect the line wrap at X chars to
> that anything which spills over to the next line is correctly commented and
> indented. I had looked at this stack overflow question, but it's not
> working for me.  However, that may just be because I'm "doing it wrong".
> >
> >
> http://stackoverflow.com/questions/7338214/nicely-formatting-long-comments-in-vim
> >
> > Can anyone point me in the right direction?
> >
> > Olaf
> > --
> > Olaf Alders
> > olaf at vilerichard.com
> >
> > http://vilerichard.com -- folk rock
> > http://twitter.com/vilerichard
> > http://cdbaby.com/cd/vilerichard
> > _______________________________________________
> > toronto-pm mailing list
> > toronto-pm at pm.org
> > http://mail.pm.org/mailman/listinfo/toronto-pm
> _______________________________________________
> toronto-pm mailing list
> toronto-pm at pm.org
> http://mail.pm.org/mailman/listinfo/toronto-pm
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20111208/278552f5/attachment.html>


More information about the toronto-pm mailing list