避免在C ++中使用标签缩进 [英] Avoiding label indenting in C++
本文介绍了避免在C ++中使用标签缩进的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我写这篇文章时,在C ++中作为范围操作符的一部分,Vim猜测它将是一个标签(在第一个:
),然后自动缩进,这是非常讨厌。示例:
When writing part of the scope operator in C++, Vim guesses that it's going to be a label (on the first :
) and then indents it automatically, which is pretty annoying. Example:
#1 - 初始键入
{
std
#2 - 添加:
/ p>
#2 - added :
{
std:
#3 - 添加:
{
std::
当然,这是正确的,任何方式禁用标签的自动缩进?我很少使用它们,并且在这些情况下不会手动缩进。
Of course, it's correct at the end, but is there any way to disable the automatic indent for labels? I rarely use them, and it wouldn't be a great deal to indent manually in those cases.
推荐答案
用以下缩排标签:
:set cinoptions+=L0
对于引用,如果visibility修饰符是指访问说明符,可以设置为不缩进:
For reference, if by "visibility" modifiers you mean access specifiers, these can be set to not indent with:
:set cinoptions+=g0
这篇关于避免在C ++中使用标签缩进的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文