加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

使用vim排列功能参数列表

发布时间:2020-12-15 18:42:12 所属栏目:安全 来源:网络整理
导读:当定义或调用具有足够参数的函数来跨越多行时,我希望 vim将它们对齐.例如, def myfunction(arg1,arg2,arg,... argsN-1,argN) 这个想法是对于argsN-1使其’a’与args1排列在一起. 有人有办法在vim中自动发生这种情况吗?我已经看到了排列等号的对齐插件(在赋
当定义或调用具有足够参数的函数来跨越多行时,我希望 vim将它们对齐.例如,
def myfunction(arg1,arg2,arg,...
               argsN-1,argN)

这个想法是对于argsN-1使其’a’与args1排列在一起.

有人有办法在vim中自动发生这种情况吗?我已经看到了排列等号的对齐插件(在赋值语句中)等等,但是我不知道是否可以解决这个问题?

以前的海报有它,但忘了集
:set cino=(0<Enter>

来自:help cinoptions-values

The 'cinoptions' option sets how Vim performs indentation.  In the list below,"N" represents a number of your choice (the number can be negative).  When
there is an 's' after the number,Vim multiplies the number by 'shiftwidth':
"1s" is 'shiftwidth',"2s" is two times 'shiftwidth',etc.  You can use a
decimal point,too: "-0.5s" is minus half a 'shiftwidth'.  The examples below
assume a 'shiftwidth' of 4.

...

    (N    When in unclosed parentheses,indent N characters from the line
          with the unclosed parentheses.  Add a 'shiftwidth' for every
          unclosed parentheses.  When N is 0 or the unclosed parentheses
          is the first non-white character in its line,line up with the
          next non-white character after the unclosed parentheses.
          (default 'shiftwidth' * 2).

            cino=                     cino=(0 >
              if (c1 && (c2 ||          if (c1 && (c2 ||
                          c3))                     c3))
                  foo;                      foo;
              if (c1 &&                 if (c1 &&
                      (c2 || c3))           (c2 || c3))
                 {                         {

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读