Is there a easy way to align phpdoc comment blocks in vim?
I want
/**
* Call an API method.
* @param string $method The API method to call, e.g. 'lists/list'
* @param array $args An array of arguments to pass to the method. Will be json-encoded for you.
* @return array Associative array of json decoded API response.
*/
to be formatted as
/**
* Call an API method.
* @param string $method The API method to call, e.g. 'lists/list'
* @param array $args An array of arguments to pass to the method. Will be json-encoded for you.
* @return array Associative array of json decoded API response.
*/
Formatting the line that contains @return may be tough, because it doesn't contain the third column. So even if I can come up with a way to align only the lines that contain @param that would be great.
Edit:
I have already tried the tabular addon, but that doesn't work since in the above case, we can't use space as the delimeter.
Edit 2:
This is the second usecase for which @PeterRincker answer is failing
/**
* Call an API method.
* @since 1.7
* @param string $method The API method to call, e.g. 'lists/list'
* @param array $args An array of arguments to pass to the method. Will be json-encoded for you.
* @return array Associative array of json decoded API response.
*/
It becomes
/**
* Call an API method.
* @since 1 .7
* @param string $method The API method to call, e.g. 'lists/list'
* @param array $args An array of arguments to pass to the method. Will be json-encoded for you.
* @return array Associative array of json decoded API response.
*/