使用vim排列功能参数列表

前端之家收集整理的这篇文章主要介绍了使用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.f2er.com/bash/386065.html

猜你在找的Bash相关文章