Skip to content

Instantly share code, notes, and snippets.

@dahu
Last active August 29, 2015 14:20
Show Gist options
  • Select an option

  • Save dahu/84150fd3e33dea60c106 to your computer and use it in GitHub Desktop.

Select an option

Save dahu/84150fd3e33dea60c106 to your computer and use it in GitHub Desktop.
Fold consecutive comment lines
" Barry Arthur, April 2015
" Fold consecutive comment lines
function! FoldComments()
1
while search('\(\n\s*\/\/\/\?.*\)\@<!\n\zs\s*\/\/\/\?', 'We')
normal! vipzf
endwhile
endfunction
@vito-c

vito-c commented Apr 30, 2015

Copy link
Copy Markdown

What does the 1 do there?

@dahu

dahu commented Apr 30, 2015

Copy link
Copy Markdown
Author

It starts from the first line in the buffer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment