微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用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))
                 {                         {

原文地址:https://www.jb51.cc/vim/386065.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐