Как мне добиться этого с vim cindent? - PullRequest
0 голосов
/ 18 октября 2011

Если я напишу следующий код в vim на данный момент

const SomeType & some_function (<ENTER>

, то vim продолжит следующую строку с отступом в две вкладки.Я хочу сделать отступ для следующей строки только с одной вкладкой.

Я знаю, cindent существует, но я не могу понять, какой синтаксис сделает это возможным.

1 Ответ

2 голосов
/ 18 октября 2011

:help cinoptions-values

(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))
             {                         {
...