如何避免命名空间内容缩进vim? [英] How to avoid namespace content indentation in vim?

查看:434
本文介绍了如何避免命名空间内容缩进vim?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设置vim不在C ++中缩进命名空间内容?

How to set vim to not indent namespace content in C++?

namespace < identifier >
{
    < statement_list > // Unwanted indentation
}

令人惊讶的是,'cinoptions'不提供编辑命名空间内容缩进的方法。

Surprisingly, 'cinoptions' doesn't provide a way to edit namespace content indentation.

推荐答案

不知道当它被介绍,但我的安装版本的vim,v7.3.353有一个cino选项,明确处理cpp命名空间。我目前正在使用示例值:

Not sure when it was introduced but my installed version of vim, v7.3.353 has a cino option that handles cpp namespace explicitly. I am currently using the example value:

cino = Ns

:help cinoptions-values

NN    Indent inside C++ namespace N characters extra compared to a
  normal block.  (default 0).

cino=                      cino=N-s 
  namespace {                namespace {
      void function();       void function();
  }                          }

  namespace my               namespace my
  {                          {
      void function();       void function();
  }                          }

OP发布的链接适用于v7.3.162

The link the OP posted is for v7.3.162

这篇关于如何避免命名空间内容缩进vim?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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