Skip to content

Instantly share code, notes, and snippets.

@branquito
Created January 24, 2013 02:19
Show Gist options
  • Save branquito/4617113 to your computer and use it in GitHub Desktop.
Save branquito/4617113 to your computer and use it in GitHub Desktop.
VIM -- PHPdoc custom commenting

Vim search and replace PHPdoc comments

install vim plugin

--> [pdv-standalone](https://github.com/mikehaertl/pdv-standalone)

..set working dir where you want to do striping/inserting phpdoc comments, then..

..load all *.php files as arglist

:args **/*.php  

..on that arglist, find all multiline php comments and strip them out..

:argdo %s/.*\/\*\*\_.\{-}\///ge

..and insert custom php comments using pdv-standalone plugin

:argdo %:call PhpDocRange()

..update/save all changed files

:argdo update

Enjoy your new comments :)

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