vim line重新格式化缩进

时间:2015-03-23 14:44:24

标签: vim indentation reformat

我试图通过我编写的一些doxygen评论并使用gq重新格式化线条以便更具可读性 - 所以我有类似的东西。

/**
 * \brief This is a brief description of the function that is made a little longer for the purposes of this example.
 *
 * \param[in]     p1        A parameter with a really long description describing it in excruciating detail.
 * \param[in]     p2        Another parameter with a really long description describing it in excruciating detail.
 *
 * \return Nothing.
*/

然后我通过设置gqsmartindent并获取此信息:

/**
 * \brief This is a brief description of the function that is made a little
 * longer for the purposes of this example.
 *
 * \param[in]     p1        A parameter with a really long description
 *  describing it in excruciating detail.
 * \param[in]     p2        Another parameter with a really long description
 * describing it in excruciating detail.
 *
 * \return Nothing.
*/

但我真正想要的是:

/**
 * \brief This is a brief description of the function that is made a little
 * longer for the purposes of this example.
 *
 * \param[in]     p1        A parameter with a really long description
 *                          describing it in excruciating detail.
 * \param[in]     p2        Another parameter with a really long description
 *                          describing it in excruciating detail.
 *
 * \return Nothing.
*/

我觉得应该有一个快速的方法在vim中这样做,但我似乎无法弄明白。

0 个答案:

没有答案