避免 C++ 中的标签缩进
我想这个问题以前有人问过,但我找不到任何类似的问题。
当用 C++ 编写部分作用域运算符时,Vim 猜测它将是一个标签 (在第一个 :
上),然后自动缩进,这非常烦人。示例:
#1 - 初始输入
{
std
#2 - 添加 :
{
std:
#3 - 添加 :
{
std::
当然,最后是正确的,但是有没有办法禁用自动缩进对于标签?我很少使用它们,在这些情况下手动缩进也没什么大不了的。
I guess this was asked before, but I could not find any similar question.
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 - initial typing
{
std
#2 - added :
{
std:
#3 - added :
{
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需告诉 vim 不要使用以下命令取消缩进标签:
作为参考,如果“可见性”修饰符指的是访问说明符,则可以将它们设置为不缩进:
Just tell vim not to de-indent labels with:
For reference, if by "visibility" modifiers you mean access specifiers, these can be set to not indent with: