2011-10-18 42 views
0

如果我此刻如何用vim cindent實現這一點?

const SomeType & some_function (<ENTER> 

寫在vim下面的代碼vim會繼續下一行的兩個標籤的縮進。我希望它只用一個選項卡縮進下一行。

我知道cindent存在,但我不能確定syntax會發生這種情況。

回答

2

: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)) 
      {       { 
+0

謝謝你找到相關文檔,但我不明白*都*!這些例子似乎隨機縮進給我,我無法以任何方式將它映射到'cino'字符串:-( – spraff

+0

另外,當標籤未擴展時它如何改變? – spraff

+3

您基本上想要通過'(1'到cinoptions。 – UncleZeiv