indentation - Vim smart tabs inside an if statement -
i'm using vim's smarttabs plugin alingn c code tabs indentation level, spaces alignment after that. works great things like
void fn(int a, ________int b) { --->...
tabs --->
, spaces _
. doesn't seem work cases like
--->if(some_variable > --->--->some_other_variable) { --->...
in case above, vim inserts tabs on second line inside parentheses. there way can modify vim sees continuation line include cases this, get:
--->if(some_variable > --->___some_other_variable) { --->...
if there's indentation style both allow flexible indentation width according one's preferences, , consistent alignment, suggested scheme it. unfortunately, style requires basic understanding of underlying syntax (e.g. whether some_other_variable
part of line-broken conditional (→ spaces) or function call within conditional (→ tab)), , makes implementing difficult.
i'm not aware of existing vim plugin. 'copyindent'
, 'preserveindent'
options bit, have explicitly insert non-indent space (and :set list
verify).
i don't know that other editor, situation similar other inferior code editors. without automatic support, otherwise elegant style have hard time gaining acceptance. love see such plugin vim.
Comments
Post a Comment