Maybe something like this would be better:<br clear="all"><br>:function CCC()<br>:  let l = line(".") + 1<br>:  let content = getline(l)<br>:  if(content =~ "^\\s*#")<br>:    execute "normal Jdf#"<br>

:    call CCC()<br>:  endif<br>:endfunction<br><br>:map ccc :call CCC()<CR><br><br>Just another Perl Hacker,<br>Fernando (SmokeMachine)<br>
<br><br><div class="gmail_quote">2011/12/8 Olaf Alders <span dir="ltr"><<a href="mailto:olaf@vilerichard.com">olaf@vilerichard.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On 2011-12-08, at 1:25 PM, Fernando Oliveira wrote:<br>
<br>
> :map ccc J:s/ #//g<CR>I# <ESC><br>
><br>
> then, <shift>+v select all comments, than press ccc<br>
<br>
</div>This came the closest of all, but it wasn't quite perfect.  It turns out that selecting the lines and and then "gq" solves it.  I had stupidly had ":set paste" in my .vimrc which was messing with the formatting.<br>


<br>
Thanks to everyone for your help!<br>
<div class="HOEnZb"><div class="h5"><br>
Olaf<br>
--<br>
Olaf Alders<br>
<a href="mailto:olaf@vilerichard.com">olaf@vilerichard.com</a><br>
<br>
<a href="http://vilerichard.com" target="_blank">http://vilerichard.com</a> -- folk rock<br>
<a href="http://twitter.com/vilerichard" target="_blank">http://twitter.com/vilerichard</a><br>
<a href="http://cdbaby.com/cd/vilerichard" target="_blank">http://cdbaby.com/cd/vilerichard</a><br>
<br>
<br>
<br>
<br>
</div></div></blockquote></div><br>