有沒有簡單的方法來對齊vim中的phpdoc註釋塊?如何在vim中對齊phpdoc註釋
我想
/**
* 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.
*/
格式化爲
/**
* 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.
*/
格式化包含@return可能是強硬的路線,因爲它不包含第三列。所以,即使我能想出一種方法來對齊只包含@param的行,那將是很棒的。
編輯:
我已經嘗試過tabular addon,但是,這並不工作,因爲在上述情況下,我們不能使用空格作爲分隔符。
編輯2:
這是第二個用例爲這@PeterRincker答案失敗
/**
* 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.
*/
它成爲
/**
* 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.
*/
表格VIM插件應該這樣做。 – Amit
@Amit我已經嘗試了表格插件,但它不會用於這種情況,因爲我們不能使用空格作爲分隔符。 – Sudar
它也可以在正則表達式上對齊。 – Amit