首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Vim格式化程序(=)是否在多行线段上进行双缩进?

Vim格式化程序(=)是否在多行线段上进行双缩进?
EN

Stack Overflow用户
提问于 2013-10-23 06:54:30
回答 1查看 90关注 0票数 1

我有一些代码:

代码语言:javascript
复制
    Vector3 targetCoords = this.GetFiringSolution(
        targetObject,
        targetObject.root.rigidbody.velocity,
        muzzle,
        verticalRotator.root.rigidbody.velocity,
        projectileForce 
    )

但当我在vim中使用(gg+G)时,它会将其转换为

代码语言:javascript
复制
    Vector3 targetCoords = this.GetFiringSolution(
            targetObject,
            targetObject.root.rigidbody.velocity,
            muzzle,
            verticalRotator.root.rigidbody.velocity,
            projectileForce 
    )

下面是my :set输出:

代码语言:javascript
复制
--- Options ---
  autoindent          cindent             fileformat=unix     history=50          modified            scroll=28           smartindent       notextmode
  background=dark     diffexpr=MyDiff()   filetype=cs         hlsearch            number              shiftwidth=4        syntax=cs           visualbell
  backup              expandtab           helplang=en         incsearch           ruler               showmatch           tabstop=4           window=57
  backspace=indent,eol,start
  comments=sO:* -,mO:*  ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
  formatoptions=croql
  keymodel=startsel,stopsel
  selection=exclusive
  selectmode=mouse,key
  viminfo=%,'100,<50,s10,h,rA:,rB:
  whichwrap=b,s,<,>,[,]
  wildignore=*.meta,*.swp

有什么办法可以阻止这种行为吗?我试着查看cimoptions,但没有完全理解。这发生在C#和PHP中的多行函数调用(和类似的事情)中--可能是其他的。

我也尝试了打开si/ai和两者,但都没有帮助。

提前谢谢。

EN

回答 1

Stack Overflow用户

发布于 2013-10-23 13:34:33

来自cinoptions-values的vim帮助

代码语言:javascript
复制
    +N    Indent a continuation line (a line that spills onto the next)
          inside a function N additional characters.  (default
          'shiftwidth').
          Outside of a function, when the previous line ended in a
          backslash, the 2 * N is used.

因此,看起来你要么完全禁用cindent,要么不得不在函数外部使用双缩进。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19529803

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档