我如何让Vim不打破DocBlock评论? [英] How can I get Vim to not break DocBlock comments?

查看:190
本文介绍了我如何让Vim不打破DocBlock评论?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

/**
 * Example Comment
 */

当我按后输入注释 Vim自动缩进,但光标与 * 字符。我如何让Vim添加 * 和一个空格,使我的注释与 E


When I press enter after Comment Vim autoindents but leaves the cursor lined up with the * characters. How can I get Vim to add the * and a space so that my comment lines up with the E?

推荐答案

您将要修改 formatoptions code> fo )Vim选项,如下所示:

You will want to modify the value of the formatoptions (short name fo) Vim option, like this:

:set fo+=or

r 选项启用插入模式;在正常情况下使用 o O 时, o 请尝试Vim的内置帮助以了解详细信息:

The r option enables the behavior in insert mode; o enables it when using o or O in normal to switch into insert. Try Vim's builtin help for details:

:help formatoptions

这篇关于我如何让Vim不打破DocBlock评论?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆